Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::CompanionAgents::Rest::Client.
REST client for the CompanionAgents service.
Service for managing companion agents.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the CompanionAgents Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all CompanionAgents clients ::Google::Cloud::Dialogflow::V2::CompanionAgents::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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::CompanionAgentCreates a companion agent.
def create_companion_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgentcreate_companion_agent via a request object, either of type
Google::Cloud::Dialogflow::V2::CreateCompanionAgentRequest or an equivalent Hash.
- 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::CompanionAgentcreate_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).
-
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.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::V2::CompanionAgent)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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::EmptyDeletes a companion agent.
def delete_companion_agent(request, options = nil) -> ::Google::Protobuf::Emptydelete_companion_agent via a request object, either of type
DeleteCompanionAgentRequest or an equivalent Hash.
- 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::Emptydelete_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).
-
name (::String) — Required. The unique resource identifier of the CompanionAgent to delete.
Format:
projects/{project}/locations/{location}/companionAgents/{companion_agent}.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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::CompanionAgentGets a companion agent.
def get_companion_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgentget_companion_agent via a request object, either of type
GetCompanionAgentRequest or an equivalent Hash.
- 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::CompanionAgentget_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).
-
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}.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::V2::CompanionAgent)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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| ... } -> ClientCreate a new CompanionAgents REST client object.
- (config) — Configure the CompanionAgents client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Dialogflow::V2::CompanionAgents::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Dialogflow::V2::CompanionAgents::Rest::Client.new do |config| config.timeout = 10.0 end
#list_companion_agents
def list_companion_agents(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::CompanionAgent>
def list_companion_agents(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::CompanionAgent>Lists companion agents.
def list_companion_agents(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::CompanionAgent>list_companion_agents via a request object, either of type
ListCompanionAgentsRequest or an equivalent Hash.
- 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::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::CompanionAgent>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).
-
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.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::CompanionAgent>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::CompanionAgent>)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (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::CompanionAgentUpdates a companion agent.
def update_companion_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::CompanionAgentupdate_companion_agent via a request object, either of type
UpdateCompanionAgentRequest or an equivalent Hash.
- 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::CompanionAgentupdate_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).
- companion_agent (::Google::Cloud::Dialogflow::V2::CompanionAgent, ::Hash) — Required. The Companion Agent to update.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Update mask for Companion Agent.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::V2::CompanionAgent)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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