Dialogflow CX V3 API - Class Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client (v0.8.1)

Reference documentation and code samples for the Dialogflow CX V3 API class Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.

Client for the EntityTypes service.

Service for managing EntityTypes.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the EntityTypes 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_entity_type

def create_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType
def create_entity_type(parent: nil, entity_type: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType

Creates an entity type in the specified agent.

Note: You should always train a flow prior to sending it queries. See the training documentation.

Overloads
def create_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType
Pass arguments to create_entity_type via a request object, either of type CreateEntityTypeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest, ::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_entity_type(parent: nil, entity_type: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType
Pass arguments to create_entity_type 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 agent to create a entity type for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
  • entity_type (::Google::Cloud::Dialogflow::CX::V3::EntityType, ::Hash) — Required. The entity type to create.
  • language_code (::String) — The language of the following fields in entity_type:

    • EntityType.entities.value
    • EntityType.entities.synonyms
    • EntityType.excluded_phrases.value

    If not specified, the agent's default language is used. Many languages are supported. Note: languages must be enabled in the agent before they can be used.

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/cx/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest.new

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

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType.
p result

#delete_entity_type

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

Deletes the specified entity type.

Note: You should always train a flow prior to sending it queries. See the training documentation.

Overloads
def delete_entity_type(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_entity_type via a request object, either of type DeleteEntityTypeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest, ::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_entity_type(name: nil, force: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_entity_type 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
  • name (::String) — Required. The name of the entity type to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type ID>.
  • force (::Boolean) —

    This field has no effect for entity type not being used. For entity types that are used by intents or pages:

    • If force is set to false, an error will be returned with message indicating the referencing resources.
    • If force is set to true, Dialogflow will remove the entity type, as well as any references to the entity type (i.e. Page parameter of the entity type will be changed to '@sys.any' and intent parameter of the entity type will be removed).
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/cx/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.new

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

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

#get_entity_type

def get_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType
def get_entity_type(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType

Retrieves the specified entity type.

Overloads
def get_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType
Pass arguments to get_entity_type via a request object, either of type GetEntityTypeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest, ::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_entity_type(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType
Pass arguments to get_entity_type 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
  • name (::String) — Required. The name of the entity type. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type ID>.
  • language_code (::String) — The language to retrieve the entity type for. The following fields are language dependent:

    • EntityType.entities.value
    • EntityType.entities.synonyms
    • EntityType.excluded_phrases.value

    If not specified, the agent's default language is used. Many languages are supported. Note: languages must be enabled in the agent before they can be used.

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/cx/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new

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

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType.
p result

#initialize

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

Create a new EntityTypes client object.

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

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

#list_entity_types

def list_entity_types(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>
def list_entity_types(parent: nil, language_code: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>

Returns the list of all entity types in the specified agent.

Overloads
def list_entity_types(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>
Pass arguments to list_entity_types via a request object, either of type ListEntityTypesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest, ::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_entity_types(parent: nil, language_code: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>
Pass arguments to list_entity_types 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 agent to list all entity types for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
  • language_code (::String) — The language to list entity types for. The following fields are language dependent:

    • EntityType.entities.value
    • EntityType.entities.synonyms
    • EntityType.excluded_phrases.value

    If not specified, the agent's default language is used. Many languages are supported. Note: languages must be enabled in the agent before they can be used.

  • 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.
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/cx/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::EntityType.
  p response
end

#update_entity_type

def update_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType
def update_entity_type(entity_type: nil, language_code: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType

Updates the specified entity type.

Note: You should always train a flow prior to sending it queries. See the training documentation.

Overloads
def update_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType
Pass arguments to update_entity_type via a request object, either of type UpdateEntityTypeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest, ::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_entity_type(entity_type: nil, language_code: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::EntityType
Pass arguments to update_entity_type 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
  • entity_type (::Google::Cloud::Dialogflow::CX::V3::EntityType, ::Hash) — Required. The entity type to update.
  • language_code (::String) — The language of the following fields in entity_type:

    • EntityType.entities.value
    • EntityType.entities.synonyms
    • EntityType.excluded_phrases.value

    If not specified, the agent's default language is used. Many languages are supported. Note: languages must be enabled in the agent before they can be used.

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — The mask to control which fields get updated.
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/cx/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest.new

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

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType.
p result