Reference documentation and code samples for the Dialogflow CX V3 API class Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.
REST client for the Agents service.
Service for managing Agents.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all Agents clients ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the Agents 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_agent
def create_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
def create_agent(parent: nil, agent: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
Creates an agent in the specified location.
Note: You should always train flows prior to sending them queries. See the training documentation.
def create_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
create_agent
via a request object, either of type
CreateAgentRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest, ::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_agent(parent: nil, agent: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
create_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. The location to create a agent for.
Format:
projects/<Project ID>/locations/<Location ID>
. - agent (::Google::Cloud::Dialogflow::CX::V3::Agent, ::Hash) — Required. The agent to create.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::CX::V3::Agent)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#delete_agent
def delete_agent(request, options = nil) -> ::Google::Protobuf::Empty
def delete_agent(name: nil) -> ::Google::Protobuf::Empty
Deletes the specified agent.
def delete_agent(request, options = nil) -> ::Google::Protobuf::Empty
delete_agent
via a request object, either of type
DeleteAgentRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest, ::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_agent(name: nil) -> ::Google::Protobuf::Empty
delete_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 name of the agent to delete.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>
.
- (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.
#export_agent
def export_agent(request, options = nil) -> ::Gapic::Operation
def export_agent(name: nil, agent_uri: nil, data_format: nil, environment: nil, git_destination: nil, include_bigquery_export_settings: nil) -> ::Gapic::Operation
Exports the specified agent to a binary file.
This method is a long-running
operation.
The returned Operation
type has the following method-specific fields:
metadata
: An empty Struct messageresponse
: ExportAgentResponse
def export_agent(request, options = nil) -> ::Gapic::Operation
export_agent
via a request object, either of type
ExportAgentRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest, ::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 export_agent(name: nil, agent_uri: nil, data_format: nil, environment: nil, git_destination: nil, include_bigquery_export_settings: nil) -> ::Gapic::Operation
export_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 name of the agent to export.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>
. -
agent_uri (::String) — Optional. The Google Cloud
Storage URI to export the agent
to. The format of this URI must be
gs://<bucket-name>/<object-name>
. If left unspecified, the serialized agent is returned inline.Dialogflow performs a write operation for the Cloud Storage object on the caller's behalf, so your request authentication must have write permissions for the object. For more information, see Dialogflow access control.
-
data_format (::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::DataFormat) — Optional. The data format of the exported agent. If not specified,
BLOB
is assumed. -
environment (::String) — Optional. Environment name. If not set, draft environment is assumed.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>
. - git_destination (::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::GitDestination, ::Hash) — Optional. The Git branch to export the agent to.
- include_bigquery_export_settings (::Boolean) — Optional. Whether to include BigQuery Export setting.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_agent
def get_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
def get_agent(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
Retrieves the specified agent.
def get_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
get_agent
via a request object, either of type
GetAgentRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::GetAgentRequest, ::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_agent(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
get_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 name of the agent.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::CX::V3::Agent)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_agent_validation_result
def get_agent_validation_result(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult
def get_agent_validation_result(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult
Gets the latest agent validation result. Agent validation is performed when ValidateAgent is called.
def get_agent_validation_result(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult
get_agent_validation_result
via a request object, either of type
GetAgentValidationResultRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest, ::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_agent_validation_result(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult
get_agent_validation_result
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 agent name.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/validationResult
. - language_code (::String) — If not specified, the agent's default language is used.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#initialize
def initialize() { |config| ... } -> Client
Create a new Agents REST client object.
- (config) — Configure the Agents client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| config.timeout = 10.0 end
#list_agents
def list_agents(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Agent>
def list_agents(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Agent>
Returns the list of all agents in the specified location.
def list_agents(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Agent>
list_agents
via a request object, either of type
ListAgentsRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest, ::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_agents(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Agent>
list_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 location to list all agents for.
Format:
projects/<Project ID>/locations/<Location ID>
. - page_size (::Integer) — The maximum number of items to return in a single page. By default 100 and at most 1000.
- page_token (::String) — The next_page_token value returned from a previous list request.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Agent>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Agent>)
- (::Google::Cloud::Error) — if the REST call is aborted.
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#operations_client
def operations_client() -> ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Operations
Get the associated client for long-running operations.
#restore_agent
def restore_agent(request, options = nil) -> ::Gapic::Operation
def restore_agent(name: nil, agent_uri: nil, agent_content: nil, git_source: nil, restore_option: nil) -> ::Gapic::Operation
Restores the specified agent from a binary file.
Replaces the current agent with a new one. Note that all existing resources in agent (e.g. intents, entity types, flows) will be removed.
This method is a long-running
operation.
The returned Operation
type has the following method-specific fields:
metadata
: An empty Struct messageresponse
: An Empty message
Note: You should always train flows prior to sending them queries. See the training documentation.
def restore_agent(request, options = nil) -> ::Gapic::Operation
restore_agent
via a request object, either of type
RestoreAgentRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest, ::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 restore_agent(name: nil, agent_uri: nil, agent_content: nil, git_source: nil, restore_option: nil) -> ::Gapic::Operation
restore_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 name of the agent to restore into.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>
. -
agent_uri (::String) — The Google Cloud Storage URI
to restore agent from. The format of this URI must be
gs://<bucket-name>/<object-name>
.Dialogflow performs a read operation for the Cloud Storage object on the caller's behalf, so your request authentication must have read permissions for the object. For more information, see Dialogflow access control.
- agent_content (::String) — Uncompressed raw byte content for agent.
- git_source (::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::GitSource, ::Hash) — Setting for restoring from a git branch
-
restore_option (::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::RestoreOption) — Agent restore mode. If not specified,
KEEP
is assumed.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#update_agent
def update_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
def update_agent(agent: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
Updates the specified agent.
Note: You should always train flows prior to sending them queries. See the training documentation.
def update_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
update_agent
via a request object, either of type
UpdateAgentRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest, ::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_agent(agent: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Agent
update_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).
- agent (::Google::Cloud::Dialogflow::CX::V3::Agent, ::Hash) — Required. The agent to update.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — The mask to control which fields get updated. If the mask is not present, all fields will be updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::CX::V3::Agent)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#validate_agent
def validate_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult
def validate_agent(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult
Validates the specified agent and creates or updates validation results. The agent in draft version is validated. Please call this API after the training is completed to get the complete validation results.
def validate_agent(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult
validate_agent
via a request object, either of type
ValidateAgentRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest, ::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 validate_agent(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult
validate_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 agent to validate.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>
. - language_code (::String) — If not specified, the agent's default language is used.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.