# Dialogflow V2 API - Class Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client (v1.16.1)

1.16.1 (latest) 1.16.0 1.15.0 1.14.0 1.13.0 1.12.1 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.0 1.5.0 1.4.1 1.3.0 1.2.0 1.1.1 1.0.0 0.34.0 0.33.0 0.32.2 0.31.0 0.30.0 0.29.0 0.28.0 0.27.0 0.26.2 0.25.0 0.24.0 0.23.0 0.22.0 0.21.0 0.20.0 0.19.0 0.18.0 0.17.1 0.16.0 0.15.2 0.14.0 0.13.0 0.12.0 Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.

REST client for the EntityTypes service.


<br />

Service for managing [EntityTypes](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType "Google::Cloud::Dialogflow::V2::EntityType (class)").

## Inherits

- Object

## Includes

- [Google::Cloud::Dialogflow::V2::EntityTypes::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Paths)

## Methods

### .configure

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

Configure the EntityTypes Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Rest-Client-Configuration "Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all EntityTypes clients
::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #batch_create_entities

    def batch_create_entities(request, options = nil) -> ::Gapic::Operation
    def batch_create_entities(parent: nil, entities: nil, language_code: nil) -> ::Gapic::Operation

Creates multiple new entities in the specified entity type.


This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

<br />

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).
**Overloads**

    def batch_create_entities(request, options = nil) -> ::Gapic::Operation

Pass arguments to `batch_create_entities` via a request object, either of type [BatchCreateEntitiesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-BatchCreateEntitiesRequest "Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-BatchCreateEntitiesRequest), ::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 batch_create_entities(parent: nil, entities: nil, language_code: nil) -> ::Gapic::Operation

Pass arguments to `batch_create_entities` 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 name of the entity type to create entities in. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
- **entities** (::Array\<[::Google::Cloud::Dialogflow::V2::EntityType::Entity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType-Entity), ::Hash\>) --- Required. The entities to create.
- **language_code** (::String) --- Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity
  data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dialogflow/v2"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #batch_delete_entities

    def batch_delete_entities(request, options = nil) -> ::Gapic::Operation
    def batch_delete_entities(parent: nil, entity_values: nil, language_code: nil) -> ::Gapic::Operation

Deletes entities in the specified entity type.


This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

<br />

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).
**Overloads**

    def batch_delete_entities(request, options = nil) -> ::Gapic::Operation

Pass arguments to `batch_delete_entities` via a request object, either of type [BatchDeleteEntitiesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-BatchDeleteEntitiesRequest "Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-BatchDeleteEntitiesRequest), ::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 batch_delete_entities(parent: nil, entity_values: nil, language_code: nil) -> ::Gapic::Operation

Pass arguments to `batch_delete_entities` 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 name of the entity type to delete entries for. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
- **entity_values** (::Array\<::String\>) --- Required. The reference `values` of the entities to delete. Note that these are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.
- **language_code** (::String) --- Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity
  data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dialogflow/v2"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #batch_delete_entity_types

    def batch_delete_entity_types(request, options = nil) -> ::Gapic::Operation
    def batch_delete_entity_types(parent: nil, entity_type_names: nil) -> ::Gapic::Operation

Deletes entity types in the specified agent.


This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

<br />

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).
**Overloads**

    def batch_delete_entity_types(request, options = nil) -> ::Gapic::Operation

Pass arguments to `batch_delete_entity_types` via a request object, either of type [BatchDeleteEntityTypesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-BatchDeleteEntityTypesRequest "Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-BatchDeleteEntityTypesRequest), ::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 batch_delete_entity_types(parent: nil, entity_type_names: nil) -> ::Gapic::Operation

Pass arguments to `batch_delete_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 name of the agent to delete all entities types for. Format: `projects/<Project ID>/agent`.
- **entity_type_names** (::Array\<::String\>) --- Required. The names entity types to delete. All names must point to the same agent as `parent`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dialogflow/v2"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #batch_update_entities

    def batch_update_entities(request, options = nil) -> ::Gapic::Operation
    def batch_update_entities(parent: nil, entities: nil, language_code: nil, update_mask: nil) -> ::Gapic::Operation

Updates or creates multiple entities in the specified entity type. This
method does not affect entities in the entity type that aren't explicitly
specified in the request.


This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

<br />

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).
**Overloads**

    def batch_update_entities(request, options = nil) -> ::Gapic::Operation

Pass arguments to `batch_update_entities` via a request object, either of type [BatchUpdateEntitiesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-BatchUpdateEntitiesRequest "Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-BatchUpdateEntitiesRequest), ::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 batch_update_entities(parent: nil, entities: nil, language_code: nil, update_mask: nil) -> ::Gapic::Operation

Pass arguments to `batch_update_entities` 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 name of the entity type to update or create entities in. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
- **entities** (::Array\<[::Google::Cloud::Dialogflow::V2::EntityType::Entity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType-Entity), ::Hash\>) --- Required. The entities to update or create.
- **language_code** (::String) --- Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity
  data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Optional. The mask to control which fields get updated.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dialogflow/v2"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #batch_update_entity_types

    def batch_update_entity_types(request, options = nil) -> ::Gapic::Operation
    def batch_update_entity_types(parent: nil, entity_type_batch_uri: nil, entity_type_batch_inline: nil, language_code: nil, update_mask: nil) -> ::Gapic::Operation

Updates/Creates multiple entity types in the specified agent.


This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: [BatchUpdateEntityTypesResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-BatchUpdateEntityTypesResponse "Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse (class)")

<br />

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).
**Overloads**

    def batch_update_entity_types(request, options = nil) -> ::Gapic::Operation

Pass arguments to `batch_update_entity_types` via a request object, either of type [BatchUpdateEntityTypesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-BatchUpdateEntityTypesRequest "Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-BatchUpdateEntityTypesRequest), ::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 batch_update_entity_types(parent: nil, entity_type_batch_uri: nil, entity_type_batch_inline: nil, language_code: nil, update_mask: nil) -> ::Gapic::Operation

Pass arguments to `batch_update_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 name of the agent to update or create entity types in. Format: `projects/<Project ID>/agent`.
- **entity_type_batch_uri** (::String) --- The URI to a Google Cloud Storage file containing entity types to update or create. The file format can either be a serialized proto (of EntityBatch type) or a JSON object. Note: The URI must start with "gs://".


  Note: The following parameters are mutually exclusive: `entity_type_batch_uri`, `entity_type_batch_inline`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **entity_type_batch_inline** ([::Google::Cloud::Dialogflow::V2::EntityTypeBatch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypeBatch), ::Hash) --- The collection of entity types to update or create.


  Note: The following parameters are mutually exclusive: `entity_type_batch_inline`, `entity_type_batch_uri`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **language_code** (::String) --- Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity
  data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Optional. The mask to control which fields get updated.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dialogflow/v2"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Rest-Client#Google__Cloud__Dialogflow__V2__EntityTypes__Rest__Client_configure_class_ "Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Rest-Client-Configuration "Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Rest-Client-Configuration))

### #create_entity_type

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

Creates an entity type in the specified agent.


<br />

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).
**Overloads**

    def create_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::EntityType

Pass arguments to `create_entity_type` via a request object, either of type [CreateEntityTypeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-CreateEntityTypeRequest "Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-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::V2::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>/agent`.
- **entity_type** ([::Google::Cloud::Dialogflow::V2::EntityType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType), ::Hash) --- Required. The entity type to create.
- **language_code** (::String) --- Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity
  data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Dialogflow::V2::EntityType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Dialogflow::V2::EntityType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dialogflow/v2"

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

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

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

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

### #delete_entity_type

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

Deletes the specified entity type.


<br />

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).
**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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-DeleteEntityTypeRequest "Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-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) -> ::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). **Parameter**

- **name** (::String) --- Required. The name of the entity type to delete. Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dialogflow/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::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::V2::EntityType
    def get_entity_type(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::V2::EntityType

Retrieves the specified entity type.
**Overloads**

    def get_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::EntityType

Pass arguments to `get_entity_type` via a request object, either of type [GetEntityTypeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-GetEntityTypeRequest "Google::Cloud::Dialogflow::V2::GetEntityTypeRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-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::V2::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>/agent/entityTypes/<EntityType ID>`.
- **language_code** (::String) --- Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity
  data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Dialogflow::V2::EntityType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Dialogflow::V2::EntityType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dialogflow/v2"

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

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

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

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

### #initialize

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

Create a new EntityTypes REST client object.
**Yields**

- (config) --- Configure the EntityTypes client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new

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

### #list_entity_types

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

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

    def list_entity_types(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>

Pass arguments to `list_entity_types` via a request object, either of type [ListEntityTypesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-ListEntityTypesRequest "Google::Cloud::Dialogflow::V2::ListEntityTypesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-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::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::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 from. Format: `projects/<Project ID>/agent`.
- **language_code** (::String) --- Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity
  data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
- **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.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Dialogflow::V2::EntityType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Dialogflow::V2::EntityType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dialogflow/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::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 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::EntityType.
  p item
end
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Rest::Client)

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Rest-Operations))

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_entity_type

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

Updates the specified entity type.


<br />

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).
**Overloads**

    def update_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::EntityType

Pass arguments to `update_entity_type` via a request object, either of type [UpdateEntityTypeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-UpdateEntityTypeRequest "Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-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::V2::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::V2::EntityType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType), ::Hash) --- Required. The entity type to update.
- **language_code** (::String) --- Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity
  data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Optional. The mask to control which fields get updated.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Dialogflow::V2::EntityType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Dialogflow::V2::EntityType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityType))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dialogflow/v2"

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

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

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

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