Dialogflow V2 API - Class Google::Cloud::Dialogflow::V2::CompanionAgents::Client (v1.18.0)

Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::CompanionAgents::Client.

Client for the CompanionAgents service.

Service for managing companion agents.

Inherits

  • Object

Methods

.configure

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

Configure the CompanionAgents 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 CompanionAgents clients
::Google::Cloud::Dialogflow::V2::CompanionAgents::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

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

#create_companion_agent

def create_companion_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent
def create_companion_agent(parent: nil, companion_agent: nil, companion_agent_id: nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent

Creates a companion agent.

Overloads
def create_companion_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent
Pass arguments to create_companion_agent via a request object, either of type Google::Cloud::Dialogflow::V2::CreateCompanionAgentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::CreateCompanionAgentRequest, ::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 create_companion_agent(parent: nil, companion_agent: nil, companion_agent_id: nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent
Pass arguments to create_companion_agent 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
  • parent (::String) — Required. Resource identifier of the project creating the companion agent. Format: projects/{project}/locations/{location}
  • companion_agent (::Google::Cloud::Dialogflow::V2::CompanionAgent, ::Hash) — Required. The companion agent to create.
  • companion_agent_id (::String) — Optional. The resource ID of the companion agent to create. If not provided, the server will auto-generate a resource ID.
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/dialogflow/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::CompanionAgents::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::CreateCompanionAgentRequest.new

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

# The returned object is of type Google::Cloud::Dialogflow::V2::CompanionAgent.
p result

#delete_companion_agent

def delete_companion_agent(request, options = nil) -> ::Google::Protobuf::Empty
def delete_companion_agent(name: nil) -> ::Google::Protobuf::Empty

Deletes a companion agent.

Overloads
def delete_companion_agent(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_companion_agent via a request object, either of type DeleteCompanionAgentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::DeleteCompanionAgentRequest, ::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 delete_companion_agent(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_companion_agent 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).
Parameter
  • name (::String) — Required. The unique resource identifier of the CompanionAgent to delete. Format: projects/{project}/locations/{location}/companionAgents/{companion_agent}.
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/dialogflow/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::CompanionAgents::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::DeleteCompanionAgentRequest.new

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

# The returned object is of type Google::Protobuf::Empty.
p result

#get_companion_agent

def get_companion_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent
def get_companion_agent(name: nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent

Gets a companion agent.

Overloads
def get_companion_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent
Pass arguments to get_companion_agent via a request object, either of type GetCompanionAgentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::GetCompanionAgentRequest, ::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 get_companion_agent(name: nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent
Pass arguments to get_companion_agent 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).
Parameter
  • name (::String) — Required. The unique resource identifier of the CompanionAgent to get all information for. Format: projects/{project}/locations/{location}/companionAgents/{companion_agent}. Contains the information about the {project}, {location}, and {companion_agent}.
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/dialogflow/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::CompanionAgents::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::GetCompanionAgentRequest.new

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

# The returned object is of type Google::Cloud::Dialogflow::V2::CompanionAgent.
p result

#initialize

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

Create a new CompanionAgents client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::Dialogflow::V2::CompanionAgents::Client.new do |config|
  config.timeout = 10.0
end

#list_companion_agents

def list_companion_agents(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::CompanionAgent>
def list_companion_agents(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::CompanionAgent>

Lists companion agents.

Overloads
def list_companion_agents(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::CompanionAgent>
Pass arguments to list_companion_agents via a request object, either of type ListCompanionAgentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::ListCompanionAgentsRequest, ::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 list_companion_agents(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::CompanionAgent>
Pass arguments to list_companion_agents 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
  • parent (::String) — Required. The parent resource name to list the companion agents for. Format: projects/{project}/locations/{location}
  • page_size (::Integer) — Optional. Maximum number of companion agents to return in a single page. By default 100 and at most 1000.
  • page_token (::String) — Optional. The page token, received from a previous call.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dialogflow/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::CompanionAgents::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::ListCompanionAgentsRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Dialogflow::V2::CompanionAgent.
  p item
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)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_companion_agent

def update_companion_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent
def update_companion_agent(companion_agent: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent

Updates a companion agent.

Overloads
def update_companion_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent
Pass arguments to update_companion_agent via a request object, either of type UpdateCompanionAgentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::UpdateCompanionAgentRequest, ::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 update_companion_agent(companion_agent: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgent
Pass arguments to update_companion_agent 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/dialogflow/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::CompanionAgents::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::UpdateCompanionAgentRequest.new

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

# The returned object is of type Google::Cloud::Dialogflow::V2::CompanionAgent.
p result