# 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.GoogleCloudContactcenterinsightsV1QaScorecardResult do
  @moduledoc """
  The results of scoring a single conversation against a QaScorecard. Contains a collection of QaAnswers and aggregate score.

  ## Attributes

  *   `agentId` (*type:* `String.t`, *default:* `nil`) - ID of the agent that handled the conversation.
  *   `conversation` (*type:* `String.t`, *default:* `nil`) - The conversation scored by this result.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp that the revision was created.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. The name of the scorecard result. Format: projects/{project}/locations/{location}/qaScorecardResults/{qa_scorecard_result}
  *   `normalizedScore` (*type:* `float()`, *default:* `nil`) - The normalized score, which is the score divided by the potential score. Any manual edits are included if they exist.
  *   `potentialScore` (*type:* `float()`, *default:* `nil`) - The maximum potential overall score of the scorecard. Any questions answered using `na_value` are excluded from this calculation.
  *   `qaAnswers` (*type:* `list(GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaAnswer.t)`, *default:* `nil`) - Set of QaAnswers represented in the result.
  *   `qaScorecardRevision` (*type:* `String.t`, *default:* `nil`) - The QaScorecardRevision scored by this result.
  *   `qaTagResults` (*type:* `list(GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultQaTagResult.t)`, *default:* `nil`) - Collection of tags and their scores.
  *   `score` (*type:* `float()`, *default:* `nil`) - The overall numerical score of the result, incorporating any manual edits if they exist.
  *   `scoreSources` (*type:* `list(GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultScoreSource.t)`, *default:* `nil`) - List of all individual score sets.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :agentId => String.t() | nil,
          :conversation => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :name => String.t() | nil,
          :normalizedScore => float() | nil,
          :potentialScore => float() | nil,
          :qaAnswers =>
            list(
              GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaAnswer.t()
            )
            | nil,
          :qaScorecardRevision => String.t() | nil,
          :qaTagResults =>
            list(
              GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultQaTagResult.t()
            )
            | nil,
          :score => float() | nil,
          :scoreSources =>
            list(
              GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultScoreSource.t()
            )
            | nil
        }

  field(:agentId)
  field(:conversation)
  field(:createTime, as: DateTime)
  field(:name)
  field(:normalizedScore)
  field(:potentialScore)

  field(:qaAnswers,
    as: GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaAnswer,
    type: :list
  )

  field(:qaScorecardRevision)

  field(:qaTagResults,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultQaTagResult,
    type: :list
  )

  field(:score)

  field(:scoreSources,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultScoreSource,
    type: :list
  )
end

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

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