Cloud Video Intelligence V1p3beta1 API - Class Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Client (v0.5.0)

Reference documentation and code samples for the Cloud Video Intelligence V1p3beta1 API class Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Client.

Client for the VideoIntelligenceService service.

Service that implements the Video Intelligence API.

Inherits

  • Object

Methods

.configure

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

Configure the VideoIntelligenceService Client class.

See Configuration for a description of the configuration fields.

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

#annotate_video

def annotate_video(request, options = nil) -> ::Gapic::Operation
def annotate_video(input_uri: nil, input_content: nil, features: nil, video_context: nil, output_uri: nil, location_id: nil) -> ::Gapic::Operation

Performs asynchronous video annotation. Progress and results can be retrieved through the google.longrunning.Operations interface. Operation.metadata contains AnnotateVideoProgress (progress). Operation.response contains AnnotateVideoResponse (results).

Overloads
def annotate_video(request, options = nil) -> ::Gapic::Operation
Pass arguments to annotate_video via a request object, either of type AnnotateVideoRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VideoIntelligence::V1p3beta1::AnnotateVideoRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def annotate_video(input_uri: nil, input_content: nil, features: nil, video_context: nil, output_uri: nil, location_id: nil) -> ::Gapic::Operation
Pass arguments to annotate_video 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
  • input_uri (::String) — Input video location. Currently, only Cloud Storage URIs are supported. URIs must be specified in the following format: gs://bucket-id/object-id (other URI formats return [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see Request URIs. To identify multiple videos, a video URI may include wildcards in the object-id. Supported wildcards: '*' to match 0 or more characters; '?' to match 1 character. If unset, the input video should be embedded in the request as input_content. If set, input_content must be unset.
  • input_content (::String) — The video data bytes. If unset, the input video(s) should be specified via the input_uri. If set, input_uri must be unset.
  • features (::Array<::Google::Cloud::VideoIntelligence::V1p3beta1::Feature>) — Required. Requested video annotation features.
  • video_context (::Google::Cloud::VideoIntelligence::V1p3beta1::VideoContext, ::Hash) — Additional video context and/or feature-specific parameters.
  • output_uri (::String) — Optional. Location where the output (in JSON format) should be stored. Currently, only Cloud Storage URIs are supported. These must be specified in the following format: gs://bucket-id/object-id (other URI formats return [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see Request URIs.
  • location_id (::String) — Optional. Cloud region where annotation should take place. Supported cloud regions are: us-east1, us-west1, europe-west1, asia-east1. If no region is specified, the region will be determined based on video file location.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/video_intelligence/v1p3beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VideoIntelligence::V1p3beta1::AnnotateVideoRequest.new

# Call the annotate_video method.
result = client.annotate_video 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

#configure

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

Configure the VideoIntelligenceService Client instance.

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

See Configuration for a description of the configuration fields.

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

#initialize

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

Create a new VideoIntelligenceService client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Client.new do |config|
  config.timeout = 10.0
end

#operations_client

def operations_client() -> ::Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Operations

Get the associated client for long-running operations.