# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3EntityType do
  @moduledoc """
  Entities are extracted from user input and represent parameters that are meaningful to your application. For example, a date range, a proper name such as a geographic location or landmark, and so on. Entities represent actionable data for your application. When you define an entity, you can also include synonyms that all map to that entity. For example, "soft drink", "soda", "pop", and so on. There are three types of entities: * **System** - entities that are defined by the Dialogflow API for common data types such as date, time, currency, and so on. A system entity is represented by the `EntityType` type. * **Custom** - entities that are defined by you that represent actionable data that is meaningful to your application. For example, you could define a `pizza.sauce` entity for red or white pizza sauce, a `pizza.cheese` entity for the different types of cheese on a pizza, a `pizza.topping` entity for different toppings, and so on. A custom entity is represented by the `EntityType` type. * **User** - entities that are built for an individual user such as favorites, preferences, playlists, and so on. A user entity is represented by the SessionEntityType type. For more information about entity types, see the [Dialogflow documentation](https://cloud.google.com/dialogflow/docs/entities-overview).

  ## Attributes

  *   `autoExpansionMode` (*type:* `String.t`, *default:* `nil`) - Indicates whether the entity type can be automatically expanded.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. The human-readable name of the entity type, unique within the agent.
  *   `enableFuzzyExtraction` (*type:* `boolean()`, *default:* `nil`) - Enables fuzzy entity extraction during classification.
  *   `entities` (*type:* `list(GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3EntityTypeEntity.t)`, *default:* `nil`) - The collection of entity entries associated with the entity type.
  *   `excludedPhrases` (*type:* `list(GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3EntityTypeExcludedPhrase.t)`, *default:* `nil`) - Collection of exceptional words and phrases that shouldn't be matched. For example, if you have a size entity type with entry `giant`(an adjective), you might consider adding `giants`(a noun) as an exclusion. If the kind of entity type is `KIND_MAP`, then the phrases specified by entities and excluded phrases should be mutually exclusive.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Required. Indicates the kind of entity type.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The unique identifier of the entity type. Required for EntityTypes.UpdateEntityType. Format: `projects//locations//agents//entityTypes/`.
  *   `redact` (*type:* `boolean()`, *default:* `nil`) - Indicates whether parameters of the entity type should be redacted in log. If redaction is enabled, page parameters and intent parameters referring to the entity type will be replaced by parameter name when logging.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :autoExpansionMode => String.t() | nil,
          :displayName => String.t() | nil,
          :enableFuzzyExtraction => boolean() | nil,
          :entities =>
            list(GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3EntityTypeEntity.t())
            | nil,
          :excludedPhrases =>
            list(
              GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3EntityTypeExcludedPhrase.t()
            )
            | nil,
          :kind => String.t() | nil,
          :name => String.t() | nil,
          :redact => boolean() | nil
        }

  field(:autoExpansionMode)
  field(:displayName)
  field(:enableFuzzyExtraction)

  field(:entities,
    as: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3EntityTypeEntity,
    type: :list
  )

  field(:excludedPhrases,
    as: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3EntityTypeExcludedPhrase,
    type: :list
  )

  field(:kind)
  field(:name)
  field(:redact)
end

defimpl Poison.Decoder, for: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3EntityType do
  def decode(value, options) do
    GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3EntityType.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3EntityType do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
