Class: Google::Cloud::VisionAI::V1::Warehouse::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb

Overview

REST client for the Warehouse service.

Service that manages media content + metadata for streaming.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#annotation_path, #asset_path, #collection_path, #corpus_path, #data_schema_path, #index_endpoint_path, #index_path, #location_path, #search_config_path, #search_hypernym_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new Warehouse REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new

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

Yields:

  • (config)

    Configure the Warehouse client.

Yield Parameters:



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 153

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @warehouse_stub = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @warehouse_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @warehouse_stub.endpoint
    config.universe_domain = @warehouse_stub.universe_domain
    config.logger = @warehouse_stub.logger if config.respond_to? :logger=
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @warehouse_stub.endpoint
    config.universe_domain = @warehouse_stub.universe_domain
    config.logger = @warehouse_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#iam_policy_clientGoogle::Iam::V1::IAMPolicy::Rest::Client (readonly)

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

Returns:

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


237
238
239
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 237

def iam_policy_client
  @iam_policy_client
end

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

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

Returns:

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


230
231
232
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 230

def location_client
  @location_client
end

#operations_client::Google::Cloud::VisionAI::V1::Warehouse::Rest::Operations (readonly)

Get the associated client for long-running operations.



223
224
225
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 223

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the Warehouse Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all Warehouse clients
::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 66

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "VisionAI", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.timeout = 60.0
    default_config.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_asset.timeout = 120.0
    default_config.rpcs.create_asset.retry_policy = {
      initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14]
    }

    default_config.rpcs.create_corpus.timeout = 120.0
    default_config.rpcs.create_corpus.retry_policy = {
      initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14]
    }

    default_config.rpcs.create_data_schema.timeout = 120.0
    default_config.rpcs.create_data_schema.retry_policy = {
      initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14]
    }

    default_config.rpcs.create_annotation.timeout = 120.0
    default_config.rpcs.create_annotation.retry_policy = {
      initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#add_collection_item(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse #add_collection_item(item: nil) ⇒ ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse

Adds an item into a Collection.

Examples:

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::Rest::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

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 5603

def add_collection_item request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.add_collection_item..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.add_collection_item.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.add_collection_item.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.add_collection_item request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#analyze_asset(request, options = nil) ⇒ ::Gapic::Operation #analyze_asset(name: nil) ⇒ ::Gapic::Operation

Analyze asset to power search capability.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the asset to analyze. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 929

def analyze_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.analyze_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.analyze_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.analyze_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.analyze_asset request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#analyze_corpus(request, options = nil) ⇒ ::Gapic::Operation #analyze_corpus(name: nil) ⇒ ::Gapic::Operation

Analyzes a corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The parent corpus resource where the assets will be analyzed. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2198

def analyze_corpus request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.analyze_corpus..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.analyze_corpus.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.analyze_corpus.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.analyze_corpus request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#clip_asset(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::ClipAssetResponse #clip_asset(name: nil, temporal_partition: nil) ⇒ ::Google::Cloud::VisionAI::V1::ClipAssetResponse

Supported by STREAM_VIDEO corpus type. 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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The time range to request clips for.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 3152

def clip_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ClipAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.clip_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.clip_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.clip_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.clip_asset request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



123
124
125
126
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 123

def configure
  yield @config if block_given?
  @config
end

#create_annotation(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Annotation #create_annotation(parent: nil, annotation: nil, annotation_id: nil) ⇒ ::Google::Cloud::VisionAI::V1::Annotation

Creates annotation inside asset.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The annotation to create.

    • annotation_id (::String) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2710

def create_annotation request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_annotation..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_annotation.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_annotation.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.create_annotation request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_asset(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Asset #create_asset(parent: nil, asset: nil, asset_id: nil) ⇒ ::Google::Cloud::VisionAI::V1::Asset

Creates an asset inside corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The asset to create.

    • asset_id (::String) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 305

def create_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.create_asset request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_collection(request, options = nil) ⇒ ::Gapic::Operation #create_collection(parent: nil, collection: nil, collection_id: nil) ⇒ ::Gapic::Operation

Creates a collection.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The collection resource to be created.

    • collection_id (::String) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 5171

def create_collection request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateCollectionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_collection..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_collection.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_collection.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.create_collection request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_corpus(request, options = nil) ⇒ ::Gapic::Operation #create_corpus(parent: nil, corpus: nil) ⇒ ::Gapic::Operation

Creates a corpus inside a project.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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:

    • parent (::String) (defaults to: nil)

      Required. Form: projects/{project_number}/locations/{location_id}

    • corpus (::Google::Cloud::VisionAI::V1::Corpus, ::Hash) (defaults to: nil)

      Required. The corpus to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 1770

def create_corpus request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateCorpusRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_corpus..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_corpus.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_corpus.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.create_corpus request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_data_schema(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::DataSchema #create_data_schema(parent: nil, data_schema: nil) ⇒ ::Google::Cloud::VisionAI::V1::DataSchema

Creates data schema inside corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The data schema to create.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2282

def create_data_schema request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_data_schema..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_data_schema.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_data_schema.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.create_data_schema request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_index(request, options = nil) ⇒ ::Gapic::Operation #create_index(parent: nil, index_id: nil, index: nil) ⇒ ::Gapic::Operation

Creates an Index under the corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The index being created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 1318

def create_index request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateIndexRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_index..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_index.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_index.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.create_index request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_index_endpoint(request, options = nil) ⇒ ::Gapic::Operation #create_index_endpoint(parent: nil, index_endpoint_id: nil, index_endpoint: nil) ⇒ ::Gapic::Operation

Creates an IndexEndpoint.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Format: projects/{project}/locations/{location}

    • index_endpoint_id (::String) (defaults to: nil)

      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) (defaults to: nil)

      Required. The resource being created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 4530

def create_index_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_index_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_index_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_index_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.create_index_endpoint request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_search_config(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchConfig #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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The search config to create.

    • search_config_id (::String) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 3437

def create_search_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_search_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_search_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_search_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.create_search_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_search_hypernym(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchHypernym #create_search_hypernym(parent: nil, search_hypernym: nil, search_hypernym_id: nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchHypernym

Creates a SearchHypernym inside a corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The SearchHypernym to create.

    • search_hypernym_id (::String) (defaults to: nil)

      Optional. The search hypernym id. If omitted, a random UUID will be generated.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 3879

def create_search_hypernym request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_search_hypernym..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_search_hypernym.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_search_hypernym.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.create_search_hypernym request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_annotation(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_annotation(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes annotation inside asset.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the annotation to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 3065

def delete_annotation request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_annotation..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_annotation.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_annotation.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.delete_annotation request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_asset(request, options = nil) ⇒ ::Gapic::Operation #delete_asset(name: nil) ⇒ ::Gapic::Operation

Deletes asset inside corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the asset to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 658

def delete_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.delete_asset request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_collection(request, options = nil) ⇒ ::Gapic::Operation #delete_collection(name: nil) ⇒ ::Gapic::Operation

Deletes a collection.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the collection to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 5259

def delete_collection request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_collection..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_collection.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_collection.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.delete_collection request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_corpus(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_corpus(name: nil) ⇒ ::Google::Protobuf::Empty

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

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the corpus to delete.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2111

def delete_corpus request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_corpus..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_corpus.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_corpus.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.delete_corpus request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_data_schema(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_data_schema(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes data schema inside corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the data schema to delete. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2524

def delete_data_schema request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_data_schema..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_data_schema.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_data_schema.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.delete_data_schema request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_index(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the index to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 1681

def delete_index request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteIndexRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_index..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_index.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_index.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.delete_index request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_index_endpoint(request, options = nil) ⇒ ::Gapic::Operation #delete_index_endpoint(name: nil) ⇒ ::Gapic::Operation

Deletes an IndexEndpoint.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 4893

def delete_index_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_index_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_index_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_index_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.delete_index_endpoint request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_search_config(request, options = nil) ⇒ ::Google::Protobuf::Empty #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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the search configuration to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 3698

def delete_search_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_search_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_search_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_search_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.delete_search_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_search_hypernym(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_search_hypernym(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a SearchHypernym inside a corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the SearchHypernym to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 4123

def delete_search_hypernym request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_search_hypernym..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_search_hypernym.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_search_hypernym.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.delete_search_hypernym request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#deploy_index(request, options = nil) ⇒ ::Gapic::Operation #deploy_index(index_endpoint: nil, deployed_index: nil) ⇒ ::Gapic::Operation

Deploys an Index to IndexEndpoint.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. IndexEndpoint the index is deployed to. Format: projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}

    • deployed_index (::Google::Cloud::VisionAI::V1::DeployedIndex, ::Hash) (defaults to: nil)

      Required. Index to deploy.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 4984

def deploy_index request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeployIndexRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.deploy_index..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.deploy_index.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.deploy_index.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.deploy_index request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#generate_hls_uri(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse #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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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>) (defaults to: nil)

      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) (defaults to: nil)

      Option to exclusively show a livestream of the asset with up to 3 minutes of backlog data.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 3240

def generate_hls_uri request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.generate_hls_uri..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.generate_hls_uri.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.generate_hls_uri.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.generate_hls_uri request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#generate_retrieval_url(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse #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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 842

def generate_retrieval_url request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.generate_retrieval_url..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.generate_retrieval_url.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.generate_retrieval_url.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.generate_retrieval_url request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_annotation(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Annotation #get_annotation(name: nil) ⇒ ::Google::Cloud::VisionAI::V1::Annotation

Reads annotation inside asset.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the annotation to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2790

def get_annotation request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAnnotationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_annotation..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_annotation.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_annotation.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.get_annotation request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_asset(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Asset #get_asset(name: nil) ⇒ ::Google::Cloud::VisionAI::V1::Asset

Reads an asset inside corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the asset to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 469

def get_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.get_asset request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_collection(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Collection #get_collection(name: nil) ⇒ ::Google::Cloud::VisionAI::V1::Collection

Gets a collection.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the collection to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 5340

def get_collection request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetCollectionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_collection..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_collection.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_collection.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.get_collection request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_corpus(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Corpus #get_corpus(name: nil) ⇒ ::Google::Cloud::VisionAI::V1::Corpus

Gets corpus details inside a project.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the corpus to retrieve.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 1850

def get_corpus request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetCorpusRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_corpus..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_corpus.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_corpus.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.get_corpus request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_data_schema(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::DataSchema #get_data_schema(name: nil) ⇒ ::Google::Cloud::VisionAI::V1::DataSchema

Gets data schema inside corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the data schema to retrieve. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2444

def get_data_schema request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_data_schema..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_data_schema.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_data_schema.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.get_data_schema request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_index(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Index #get_index(name: nil) ⇒ ::Google::Cloud::VisionAI::V1::Index

Gets the details of a single Index under a Corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the Index resource. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 1496

def get_index request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetIndexRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_index..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_index.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_index.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.get_index request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_index_endpoint(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::IndexEndpoint #get_index_endpoint(name: nil) ⇒ ::Google::Cloud::VisionAI::V1::IndexEndpoint

Gets an IndexEndpoint.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the IndexEndpoint resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 4610

def get_index_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_index_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_index_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_index_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.get_index_endpoint request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_search_config(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchConfig #get_search_config(name: nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchConfig

Gets a search configuration inside a corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the search configuration to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 3615

def get_search_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_search_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_search_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_search_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.get_search_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_search_hypernym(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchHypernym #get_search_hypernym(name: nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchHypernym

Gets a SearchHypernym inside a corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the SearchHypernym to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 4043

def get_search_hypernym request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_search_hypernym..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_search_hypernym.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_search_hypernym.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.get_search_hypernym request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#import_assets(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The parent corpus resource where the assets will be imported. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 3334

def import_assets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ImportAssetsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.import_assets..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.import_assets.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.import_assets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.import_assets request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#index_asset(request, options = nil) ⇒ ::Gapic::Operation #index_asset(name: nil, index: nil) ⇒ ::Gapic::Operation

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

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. The resource name of the asset to index. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}

    • index (::String) (defaults to: nil)

      Optional. The name of the index. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 1023

def index_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::IndexAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.index_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.index_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.index_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.index_asset request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists a list of annotations inside asset.

Examples:

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::Rest::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

Overloads:

  • #list_annotations(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_annotations(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      The parent, which owns this collection of annotations. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2900

def list_annotations request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_annotations..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_annotations.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_annotations.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.list_annotations request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_annotations, "annotations", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists an list of assets inside corpus.

Examples:

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::Rest::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

Overloads:

  • #list_assets(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_assets(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. The parent, which owns this collection of assets. Format: projects/{project_number}/locations/{location}/corpora/{corpus}

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 569

def list_assets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAssetsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_assets..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_assets.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_assets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.list_assets request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_assets, "assets", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists collections inside a corpus.

Examples:

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::Rest::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

Overloads:

  • #list_collections(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_collections(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. The parent corpus. Format: projects/{project_number}/locations/{location}/corpora/{corpus}

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 5523

def list_collections request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListCollectionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_collections..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_collections.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_collections.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.list_collections request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_collections, "collections", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists all corpora in a project.

Examples:

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::Rest::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

Overloads:

  • #list_corpora(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_corpora(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. The resource name of the project from which to list corpora.

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      The filter applied to the returned corpora list. Only the following restrictions are supported: type=<Corpus.Type>, type!=<Corpus.Type>.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2030

def list_corpora request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListCorporaRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_corpora..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_corpora.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_corpora.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.list_corpora request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_corpora, "corpora", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists a list of data schemas inside corpus.

Examples:

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::Rest::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

Overloads:

  • #list_data_schemas(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_data_schemas(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. The parent, which owns this collection of data schemas. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2618

def list_data_schemas request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_data_schemas..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_data_schemas.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_data_schemas.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.list_data_schemas request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_data_schemas, "data_schemas", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists all IndexEndpoints in a project.

Examples:

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::Rest::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

Overloads:

  • #list_index_endpoints(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_index_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. Format: projects/{project}/locations/{location}

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 4711

def list_index_endpoints request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_index_endpoints..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_index_endpoints.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_index_endpoints.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.list_index_endpoints request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_index_endpoints, "index_endpoints", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

List all Indexes in a given Corpus.

Examples:

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::Rest::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

Overloads:

  • #list_indexes(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_indexes(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. The parent corpus that owns this collection of indexes. Format: projects/{project_number}/locations/{location}/corpora/{corpus}

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 1591

def list_indexes request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListIndexesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_indexes..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_indexes.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_indexes.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.list_indexes request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_indexes, "indexes", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists all search configurations inside a corpus.

Examples:

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::Rest::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

Overloads:

  • #list_search_configs(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_search_configs(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. The parent, which owns this collection of search configurations. Format: projects/{project_number}/locations/{location}/corpora/{corpus}

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 3793

def list_search_configs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_search_configs..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_search_configs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_search_configs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.list_search_configs request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_search_configs, "search_configs", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists SearchHypernyms inside a corpus.

Examples:

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::Rest::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

Overloads:

  • #list_search_hypernyms(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_search_hypernyms(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. The parent, which owns this collection of SearchHypernyms. Format: projects/{project_number}/locations/{location}/corpora/{corpus}

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 4218

def list_search_hypernyms request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_search_hypernyms..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_search_hypernyms.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_search_hypernyms.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.list_search_hypernyms request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_search_hypernyms, "search_hypernyms", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


244
245
246
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 244

def logger
  @warehouse_stub.logger
end

#remove_collection_item(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse #remove_collection_item(item: nil) ⇒ ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse

Removes an item from a collection.

Examples:

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::Rest::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

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 5681

def remove_collection_item request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.remove_collection_item..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.remove_collection_item.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.remove_collection_item.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.remove_collection_item request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#remove_index_asset(request, options = nil) ⇒ ::Gapic::Operation #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

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. The resource name of the asset to index. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}

    • index (::String) (defaults to: nil)

      Optional. The name of the index. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 1117

def remove_index_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.remove_index_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.remove_index_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.remove_index_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.remove_index_asset request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#search_assets(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchAssetsResponse #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) ⇒ ::Google::Cloud::VisionAI::V1::SearchAssetsResponse

Search media asset.

Examples:

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::Rest::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

Overloads:

  • #search_assets(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchAssetsResponse

    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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) ⇒ ::Google::Cloud::VisionAI::V1::SearchAssetsResponse

    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) (defaults to: nil)

      Sort by the value under the data schema key.

    • corpus (::String) (defaults to: nil)

      Required. The parent corpus to search. Format: projects/{project_id}/locations/{location_id}/corpora/{corpus_id}

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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>) (defaults to: nil)

      Criteria applied to search results.

    • facet_selections (::Array<::Google::Cloud::VisionAI::V1::FacetGroup, ::Hash>) (defaults to: nil)

      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>) (defaults to: nil)

      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) (defaults to: nil)

      Global search query. Allows user to search assets without needing to specify which field the value belongs to.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 4331

def search_assets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::SearchAssetsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.search_assets..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.search_assets.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.search_assets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.search_assets request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

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

Examples:

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::Rest::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

Overloads:

  • #search_index_endpoint(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #search_index_endpoint(image_query: nil, text_query: nil, index_endpoint: nil, criteria: nil, exclusion_criteria: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      An image-only query.

    • text_query (::String) (defaults to: nil)

      A text-only query.

    • index_endpoint (::String) (defaults to: nil)

      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>) (defaults to: nil)

      Criteria applied to search results.

    • exclusion_criteria (::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>) (defaults to: nil)

      Criteria to exclude from search results. Note that fetch_matched_annotations will be ignored.

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      The continuation token to fetch the next page. If empty, it means it is fetching the first page.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 4433

def search_index_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.search_index_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.search_index_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.search_index_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.search_index_endpoint request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :search_index_endpoint, "search_result_items", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#undeploy_index(request, options = nil) ⇒ ::Gapic::Operation #undeploy_index(index_endpoint: nil) ⇒ ::Gapic::Operation

Undeploys an Index from IndexEndpoint.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • index_endpoint (::String) (defaults to: nil)

      Required. Resource name of the IndexEndpoint resource on which the undeployment will act. Format: projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 5073

def undeploy_index request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UndeployIndexRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.undeploy_index..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.undeploy_index.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.undeploy_index.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.undeploy_index request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


133
134
135
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 133

def universe_domain
  @warehouse_stub.universe_domain
end

#update_annotation(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Annotation #update_annotation(annotation: nil, update_mask: nil) ⇒ ::Google::Cloud::VisionAI::V1::Annotation

Updates annotation inside asset.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      The list of fields to be updated.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2985

def update_annotation request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_annotation..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_annotation.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_annotation.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.update_annotation request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_asset(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Asset #update_asset(asset: nil, update_mask: nil) ⇒ ::Google::Cloud::VisionAI::V1::Asset

Updates an asset inside corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      The list of fields to be updated.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 389

def update_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.update_asset request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_collection(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Collection #update_collection(collection: nil, update_mask: nil) ⇒ ::Google::Cloud::VisionAI::V1::Collection

Updates a collection.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 5430

def update_collection request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_collection..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_collection.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_collection.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.update_collection request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_corpus(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Corpus #update_corpus(corpus: nil, update_mask: nil) ⇒ ::Google::Cloud::VisionAI::V1::Corpus

Updates a corpus in a project.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 1930

def update_corpus request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_corpus..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_corpus.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_corpus.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.update_corpus request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_data_schema(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::DataSchema #update_data_schema(data_schema: nil, update_mask: nil) ⇒ ::Google::Cloud::VisionAI::V1::DataSchema

Updates data schema inside corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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:

    • data_schema (::Google::Cloud::VisionAI::V1::DataSchema, ::Hash) (defaults to: nil)

      Required. The data schema's name field is used to identify the data schema to be updated. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      The list of fields to be updated.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 2364

def update_data_schema request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_data_schema..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_data_schema.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_data_schema.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.update_data_schema request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_index(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. The resource being updated.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 1414

def update_index request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateIndexRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_index..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_index.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_index.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.update_index request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_index_endpoint(request, options = nil) ⇒ ::Gapic::Operation #update_index_endpoint(index_endpoint: nil, update_mask: nil) ⇒ ::Gapic::Operation

Updates an IndexEndpoint.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. The resource being updated.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 4806

def update_index_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_index_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_index_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_index_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.update_index_endpoint request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_search_config(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchConfig #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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      The list of fields to be updated. If left unset, all field paths will be updated/overwritten.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 3535

def update_search_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_search_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_search_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_search_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.update_search_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_search_hypernym(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchHypernym #update_search_hypernym(search_hypernym: nil, update_mask: nil) ⇒ ::Google::Cloud::VisionAI::V1::SearchHypernym

Updates a SearchHypernym inside a corpus.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      The list of fields to be updated. If left unset, all field paths will be updated/overwritten.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 3963

def update_search_hypernym request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_search_hypernym..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_search_hypernym.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_search_hypernym.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.update_search_hypernym request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#upload_asset(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      The source of the asset.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 758

def upload_asset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UploadAssetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.upload_asset..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.upload_asset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.upload_asset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.upload_asset request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

View items inside a collection.

Examples:

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::Rest::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

Overloads:

  • #view_collection_items(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #view_collection_items(collection: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. The collection to view. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 5775

def view_collection_items request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.view_collection_items..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.view_collection_items.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.view_collection_items.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.view_collection_items request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :view_collection_items, "items", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists assets inside an index.

Examples:

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::Rest::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

Overloads:

  • #view_indexed_assets(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #view_indexed_assets(index: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. The index that owns this collection of assets. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
# File 'lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb', line 1219

def view_indexed_assets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.view_indexed_assets..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.view_indexed_assets.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.view_indexed_assets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @warehouse_stub.view_indexed_assets request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :view_indexed_assets, "indexed_assets", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end