Reference documentation and code samples for the Cloud Video Intelligence V1p2beta1 API class Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Rest::Client.
REST client for the VideoIntelligenceService service.
Service that implements Google Cloud 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all VideoIntelligenceService clients ::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Rest::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).
def annotate_video(request, options = nil) -> ::Gapic::Operation
annotate_video
via a request object, either of type
AnnotateVideoRequest or an equivalent Hash.
- request (::Google::Cloud::VideoIntelligence::V1p2beta1::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
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).
-
input_uri (::String) — Input video location. Currently, only
Google Cloud Storage URIs are
supported, which 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. A video URI may include wildcards inobject-id
, and thus identify multiple videos. Supported wildcards: '*' to match 0 or more characters; '?' to match 1 character. If unset, the input video should be embedded in the request asinput_content
. If set,input_content
should be unset. -
input_content (::String) — The video data bytes.
If unset, the input video(s) should be specified via
input_uri
. If set,input_uri
should be unset. - features (::Array<::Google::Cloud::VideoIntelligence::V1p2beta1::Feature>) — Required. Requested video annotation features.
- video_context (::Google::Cloud::VideoIntelligence::V1p2beta1::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 Google Cloud Storage
URIs are supported, which 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:
us-east1
,us-west1
,europe-west1
,asia-east1
. If no region is specified, a region will be determined based on video file location.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/video_intelligence/v1p2beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::VideoIntelligence::V1p2beta1::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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#initialize
def initialize() { |config| ... } -> Client
Create a new VideoIntelligenceService REST client object.
- (config) — Configure the VideoIntelligenceService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Rest::Client.new do |config| config.timeout = 10.0 end
#operations_client
def operations_client() -> ::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Rest::Operations
Get the associated client for long-running operations.