# Cloud Video Intelligence V1beta2 API - Class Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Rest::Client (v0.17.0)

0.17.0 (latest) 0.16.0 0.15.1 0.14.0 0.13.0 0.12.1 0.11.0 0.10.2 0.9.2 0.8.0 0.7.1 0.6.0 0.5.0 0.4.5 Reference documentation and code samples for the Cloud Video Intelligence V1beta2 API class Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Rest::Client.

REST client for the VideoIntelligenceService service.


<br />

Service that implements Google Cloud Video Intelligence API.

## Inherits

- Object

## Methods

### .configure

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

Configure the VideoIntelligenceService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-VideoIntelligenceService-Rest-Client-Configuration "Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-VideoIntelligenceService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-VideoIntelligenceService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all VideoIntelligenceService clients
::Google::Cloud::VideoIntelligence::V1beta2::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).
**Overloads**

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

Pass arguments to `annotate_video` via a request object, either of type [AnnotateVideoRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-AnnotateVideoRequest "Google::Cloud::VideoIntelligence::V1beta2::AnnotateVideoRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::VideoIntelligence::V1beta2::AnnotateVideoRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-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 [Google Cloud Storage](https://cloud.google.com/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](https://cloud.google.com/storage/docs/request-endpoints). A video URI may include wildcards in `object-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 as `input_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::V1beta2::Feature](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-Feature)\>) --- Required. Requested video annotation features.
- **video_context** ([::Google::Cloud::VideoIntelligence::V1beta2::VideoContext](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-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](https://cloud.google.com/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](https://cloud.google.com/storage/docs/request-endpoints).
- **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.
**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.
**Example**

Basic example

```ruby
require "google/cloud/video_intelligence/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VideoIntelligence::V1beta2::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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-VideoIntelligenceService-Rest-Client#Google__Cloud__VideoIntelligence__V1beta2__VideoIntelligenceService__Rest__Client_configure_class_ "Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-VideoIntelligenceService-Rest-Client-Configuration "Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-VideoIntelligenceService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-VideoIntelligenceService-Rest-Client-Configuration))

### #initialize

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

Create a new VideoIntelligenceService REST client object.
**Yields**

- (config) --- Configure the VideoIntelligenceService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-VideoIntelligenceService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-VideoIntelligenceService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Rest::Client.new

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

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #operations_client

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

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-video_intelligence-v1beta2/latest/Google-Cloud-VideoIntelligence-V1beta2-VideoIntelligenceService-Rest-Operations))

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)