# 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.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestion do
  @moduledoc """
  A single question to be scored by the Insights QA feature.

  ## Attributes

  *   `abbreviation` (*type:* `String.t`, *default:* `nil`) - Short, descriptive string, used in the UI where it's not practical to display the full question body. E.g., "Greeting".
  *   `answerChoices` (*type:* `list(GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestionAnswerChoice.t)`, *default:* `nil`) - A list of valid answers to the question, which the LLM must choose from.
  *   `answerInstructions` (*type:* `String.t`, *default:* `nil`) - Instructions describing how to determine the answer.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time at which this question was created.
  *   `metrics` (*type:* `GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestionMetrics.t`, *default:* `nil`) - Metrics of the underlying tuned LLM over a holdout/test set while fine tuning the underlying LLM for the given question. This field will only be populated if and only if the question is part of a scorecard revision that has been tuned.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. The resource name of the question. Format: projects/{project}/locations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision}/qaQuestions/{qa_question}
  *   `order` (*type:* `integer()`, *default:* `nil`) - Defines the order of the question within its parent scorecard revision.
  *   `questionBody` (*type:* `String.t`, *default:* `nil`) - Question text. E.g., "Did the agent greet the customer?"
  *   `tags` (*type:* `list(String.t)`, *default:* `nil`) - User-defined list of arbitrary tags for the question. Used for grouping/organization and for weighting the score of each question.
  *   `tuningMetadata` (*type:* `GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestionTuningMetadata.t`, *default:* `nil`) - Metadata about the tuning operation for the question.This field will only be populated if and only if the question is part of a scorecard revision that has been tuned.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The most recent time at which the question was updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :abbreviation => String.t() | nil,
          :answerChoices =>
            list(
              GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestionAnswerChoice.t()
            )
            | nil,
          :answerInstructions => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :metrics =>
            GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestionMetrics.t()
            | nil,
          :name => String.t() | nil,
          :order => integer() | nil,
          :questionBody => String.t() | nil,
          :tags => list(String.t()) | nil,
          :tuningMetadata =>
            GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestionTuningMetadata.t()
            | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:abbreviation)

  field(:answerChoices,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestionAnswerChoice,
    type: :list
  )

  field(:answerInstructions)
  field(:createTime, as: DateTime)

  field(:metrics,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestionMetrics
  )

  field(:name)
  field(:order)
  field(:questionBody)
  field(:tags, type: :list)

  field(:tuningMetadata,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestionTuningMetadata
  )

  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder,
  for: GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestion do
  def decode(value, options) do
    GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestion.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaQuestion do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
