Reference documentation and code samples for the Dialogflow CX V3 API class Google::Cloud::Dialogflow::CX::V3::Tools::Client.
Client for the Tools service.
Service for managing Tools.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all Tools clients ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the Tools 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_tool
def create_tool(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Tool
def create_tool(parent: nil, tool: nil) -> ::Google::Cloud::Dialogflow::CX::V3::ToolCreates a Tool in the specified agent.
def create_tool(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Toolcreate_tool via a request object, either of type
CreateToolRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::CreateToolRequest, ::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_tool(parent: nil, tool: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Toolcreate_tool 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 agent to create a Tool for.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>. - tool (::Google::Cloud::Dialogflow::CX::V3::Tool, ::Hash) — Required. The Tool to be created.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::Tool)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::CreateToolRequest.new # Call the create_tool method. result = client.create_tool request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Tool. p result
#create_tool_version
def create_tool_version(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::ToolVersion
def create_tool_version(parent: nil, tool_version: nil) -> ::Google::Cloud::Dialogflow::CX::V3::ToolVersionCreates a version for the specified Tool.
def create_tool_version(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::ToolVersioncreate_tool_version via a request object, either of type
CreateToolVersionRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest, ::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_tool_version(parent: nil, tool_version: nil) -> ::Google::Cloud::Dialogflow::CX::V3::ToolVersioncreate_tool_version 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 tool to create a version for.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>. - tool_version (::Google::Cloud::Dialogflow::CX::V3::ToolVersion, ::Hash) — Required. The tool version to create.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::ToolVersion)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::CreateToolVersionRequest.new # Call the create_tool_version method. result = client.create_tool_version request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::ToolVersion. p result
#delete_tool
def delete_tool(request, options = nil) -> ::Google::Protobuf::Empty
def delete_tool(name: nil, force: nil) -> ::Google::Protobuf::EmptyDeletes a specified Tool.
def delete_tool(request, options = nil) -> ::Google::Protobuf::Emptydelete_tool via a request object, either of type
DeleteToolRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::DeleteToolRequest, ::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_tool(name: nil, force: nil) -> ::Google::Protobuf::Emptydelete_tool 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 Tool to be deleted.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>. -
force (::Boolean) —
This field has no effect for Tools not being used. For Tools that are used:
- If
forceis set to false, an error will be returned with message indicating the referenced resources. - If
forceis set to true, Dialogflow will remove the tool, as well as any references to the tool.
- If
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::DeleteToolRequest.new # Call the delete_tool method. result = client.delete_tool request # The returned object is of type Google::Protobuf::Empty. p result
#delete_tool_version
def delete_tool_version(request, options = nil) -> ::Google::Protobuf::Empty
def delete_tool_version(name: nil, force: nil) -> ::Google::Protobuf::EmptyDeletes the specified version of the Tool.
def delete_tool_version(request, options = nil) -> ::Google::Protobuf::Emptydelete_tool_version via a request object, either of type
DeleteToolVersionRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest, ::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_tool_version(name: nil, force: nil) -> ::Google::Protobuf::Emptydelete_tool_version 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 tool version to delete.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>/versions/<VersionID>. -
force (::Boolean) —
Optional. This field has no effect for Tools not being used. For Tools that are used:
- If
forceis set to false, an error will be returned with message indicating the referenced resources. - If
forceis set to true, Dialogflow will remove the tool, as well as any references to the tool.
- If
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::DeleteToolVersionRequest.new # Call the delete_tool_version method. result = client.delete_tool_version request # The returned object is of type Google::Protobuf::Empty. p result
#get_tool
def get_tool(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Tool
def get_tool(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::ToolRetrieves the specified Tool.
def get_tool(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Toolget_tool via a request object, either of type
GetToolRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::GetToolRequest, ::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_tool(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Toolget_tool 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 Tool.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::Tool)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::GetToolRequest.new # Call the get_tool method. result = client.get_tool request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Tool. p result
#get_tool_version
def get_tool_version(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::ToolVersion
def get_tool_version(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::ToolVersionRetrieves the specified version of the Tool.
def get_tool_version(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::ToolVersionget_tool_version via a request object, either of type
GetToolVersionRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest, ::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_tool_version(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::ToolVersionget_tool_version 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 tool version.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>/versions/<VersionID>.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::ToolVersion)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::GetToolVersionRequest.new # Call the get_tool_version method. result = client.get_tool_version request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::ToolVersion. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new Tools client object.
- (config) — Configure the Tools client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Dialogflow::CX::V3::Tools::Client.new do |config| config.timeout = 10.0 end
#list_tool_versions
def list_tool_versions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ToolVersion>
def list_tool_versions(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ToolVersion>List versions of the specified Tool.
def list_tool_versions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ToolVersion>list_tool_versions via a request object, either of type
ListToolVersionsRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest, ::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_tool_versions(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ToolVersion>list_tool_versions 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 of the tool versions.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>. - page_size (::Integer) — Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.
- page_token (::String) — Optional. The next_page_token value returned from a previous list request.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ToolVersion>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ToolVersion>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::ListToolVersionsRequest.new # Call the list_tool_versions method. result = client.list_tool_versions 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::CX::V3::ToolVersion. p item end
#list_tools
def list_tools(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Tool>
def list_tools(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Tool>Returns a list of Tools in the specified agent.
def list_tools(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Tool>list_tools via a request object, either of type
ListToolsRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::ListToolsRequest, ::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_tools(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Tool>list_tools 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 agent to list the Tools from.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>. - 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Tool>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Tool>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::ListToolsRequest.new # Call the list_tools method. result = client.list_tools 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::CX::V3::Tool. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#restore_tool_version
def restore_tool_version(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse
def restore_tool_version(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponseRetrieves the specified version of the Tool and stores it as the current tool draft, returning the tool with resources updated.
def restore_tool_version(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponserestore_tool_version via a request object, either of type
RestoreToolVersionRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest, ::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_tool_version(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponserestore_tool_version 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 tool version.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>/versions/<VersionID>.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionRequest.new # Call the restore_tool_version method. result = client.restore_tool_version request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::RestoreToolVersionResponse. p result
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)
#update_tool
def update_tool(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Tool
def update_tool(tool: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::ToolUpdate the specified Tool.
def update_tool(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Toolupdate_tool via a request object, either of type
UpdateToolRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::UpdateToolRequest, ::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_tool(tool: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Toolupdate_tool 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).
- tool (::Google::Cloud::Dialogflow::CX::V3::Tool, ::Hash) — Required. The Tool to be updated.
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::Tool)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::Tools::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::UpdateToolRequest.new # Call the update_tool method. result = client.update_tool request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Tool. p result