lib/google_api/dialogflow/v2/model/google_cloud_dialogflow_v2beta1_knowledge_answers_answer.ex

# 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.V2.Model.GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer do
  @moduledoc """
  An answer from Knowledge Connector.

  ## Attributes

  *   `answer` (*type:* `String.t`, *default:* `nil`) - The piece of text from the `source` knowledge base document that answers this conversational query.
  *   `faqQuestion` (*type:* `String.t`, *default:* `nil`) - The corresponding FAQ question if the answer was extracted from a FAQ Document, empty otherwise.
  *   `matchConfidence` (*type:* `number()`, *default:* `nil`) - The system's confidence score that this Knowledge answer is a good match for this conversational query. The range is from 0.0 (completely uncertain) to 1.0 (completely certain). Note: The confidence score is likely to vary somewhat (possibly even for identical requests), as the underlying model is under constant improvement. It may be deprecated in the future. We recommend using `match_confidence_level` which should be generally more stable.
  *   `matchConfidenceLevel` (*type:* `String.t`, *default:* `nil`) - The system's confidence level that this knowledge answer is a good match for this conversational query. NOTE: The confidence level for a given `` pair may change without notice, as it depends on models that are constantly being improved. However, it will change less frequently than the confidence score below, and should be preferred for referencing the quality of an answer.
  *   `source` (*type:* `String.t`, *default:* `nil`) - Indicates which Knowledge Document this answer was extracted from. Format: `projects//knowledgeBases//documents/`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :answer => String.t() | nil,
          :faqQuestion => String.t() | nil,
          :matchConfidence => number() | nil,
          :matchConfidenceLevel => String.t() | nil,
          :source => String.t() | nil
        }

  field(:answer)
  field(:faqQuestion)
  field(:matchConfidence)
  field(:matchConfidenceLevel)
  field(:source)
end

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

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