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.
- (config) — Configure the Client client.
- config (Client::Configuration)
# 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.
def acquire_lease(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Lease
acquire_lease
via a request object, either of type
AcquireLeaseRequest or an equivalent Hash.
- 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
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).
- series (::String) — The series name.
- owner (::String) — The owner name.
- term (::Google::Protobuf::Duration, ::Hash) — The lease term.
- lease_type (::Google::Cloud::VisionAI::V1::LeaseType) — The lease type.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::VisionAI::V1::Lease)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#iam_policy_client
def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Client
Get the associated client for mix-in of the IAMPolicy.
- (Google::Iam::V1::IAMPolicy::Client)
#initialize
def initialize() { |config| ... } -> Client
Create a new StreamingService client object.
- (config) — Configure the StreamingService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# 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.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> Logger
The logger used for request/response debug logging.
- (Logger)
#receive_events
def receive_events(request, options = nil) { |response, operation| ... } -> ::Enumerable<::Google::Cloud::VisionAI::V1::ReceiveEventsResponse>
Receive events given the stream name.
- request (::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VisionAI::V1::ReceiveEventsRequest, ::Hash>) — An enumerable of ReceiveEventsRequest instances.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
- (response, operation) — Access the result along with the RPC operation
- response (::Enumerable<::Google::Cloud::VisionAI::V1::ReceiveEventsResponse>)
- operation (::GRPC::ActiveCall::Operation)
- (::Enumerable<::Google::Cloud::VisionAI::V1::ReceiveEventsResponse>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
- request (::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VisionAI::V1::ReceivePacketsRequest, ::Hash>) — An enumerable of ReceivePacketsRequest instances.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
- (response, operation) — Access the result along with the RPC operation
- response (::Enumerable<::Google::Cloud::VisionAI::V1::ReceivePacketsResponse>)
- operation (::GRPC::ActiveCall::Operation)
- (::Enumerable<::Google::Cloud::VisionAI::V1::ReceivePacketsResponse>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def release_lease(request, options = nil) -> ::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse
release_lease
via a request object, either of type
ReleaseLeaseRequest or an equivalent Hash.
- 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
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).
- id (::String) — Lease id.
- series (::String) — Series name.
- owner (::String) — Lease owner.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def renew_lease(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Lease
renew_lease
via a request object, either of type
RenewLeaseRequest or an equivalent Hash.
- 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
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).
- id (::String) — Lease id.
- series (::String) — Series name.
- owner (::String) — Lease owner.
- term (::Google::Protobuf::Duration, ::Hash) — Lease term.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::VisionAI::V1::Lease)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
- request (::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VisionAI::V1::SendPacketsRequest, ::Hash>) — An enumerable of Google::Cloud::VisionAI::V1::SendPacketsRequest instances.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
- (response, operation) — Access the result along with the RPC operation
- response (::Enumerable<::Google::Cloud::VisionAI::V1::SendPacketsResponse>)
- operation (::GRPC::ActiveCall::Operation)
- (::Enumerable<::Google::Cloud::VisionAI::V1::SendPacketsResponse>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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
- (String)