Vision AI V1 API - Class Google::Cloud::VisionAI::V1::StreamingService::Client (v0.2.0)

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

Client for the StreamingService service.

Streaming service for receiving and sending packets.

Inherits

  • Object

Methods

.configure

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

Configure the StreamingService 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 StreamingService clients
::Google::Cloud::VisionAI::V1::StreamingService::Client.configure do |config|
  config.timeout = 10.0
end

#acquire_lease

def acquire_lease(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Lease
def acquire_lease(series: nil, owner: nil, term: nil, lease_type: nil) -> ::Google::Cloud::VisionAI::V1::Lease

AcquireLease acquires a lease.

Overloads
def acquire_lease(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Lease
Pass arguments to acquire_lease via a request object, either of type AcquireLeaseRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::AcquireLeaseRequest, ::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 acquire_lease(series: nil, owner: nil, term: nil, lease_type: nil) -> ::Google::Cloud::VisionAI::V1::Lease
Pass arguments to acquire_lease via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

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

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

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

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

#configure

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

Configure the StreamingService 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

#iam_policy_client

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

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

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

#initialize

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

Create a new StreamingService client object.

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

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

#location_client

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

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

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

#receive_events

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

Receive events given the stream name.

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

Basic example

require "google/cloud/vision_ai/v1"

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

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

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

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

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

#receive_packets

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

Receive packets from the series.

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

Basic example

require "google/cloud/vision_ai/v1"

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

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

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

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

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

#release_lease

def release_lease(request, options = nil) -> ::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse
def release_lease(id: nil, series: nil, owner: nil) -> ::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse

RleaseLease releases a lease.

Overloads
def release_lease(request, options = nil) -> ::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse
Pass arguments to release_lease via a request object, either of type ReleaseLeaseRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest, ::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 release_lease(id: nil, series: nil, owner: nil) -> ::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse
Pass arguments to release_lease 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
  • id (::String) — Lease id.
  • series (::String) — Series name.
  • owner (::String) — Lease owner.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

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

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

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

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

#renew_lease

def renew_lease(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Lease
def renew_lease(id: nil, series: nil, owner: nil, term: nil) -> ::Google::Cloud::VisionAI::V1::Lease

RenewLease renews a lease.

Overloads
def renew_lease(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Lease
Pass arguments to renew_lease via a request object, either of type RenewLeaseRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::RenewLeaseRequest, ::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 renew_lease(id: nil, series: nil, owner: nil, term: nil) -> ::Google::Cloud::VisionAI::V1::Lease
Pass arguments to renew_lease 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
  • id (::String) — Lease id.
  • series (::String) — Series name.
  • owner (::String) — Lease owner.
  • term (::Google::Protobuf::Duration, ::Hash) — Lease term.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

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

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

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

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

#send_packets

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

Send packets to the series.

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

Basic example

require "google/cloud/vision_ai/v1"

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

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

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

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

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

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)