# 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.GoogleCloudContactcenterinsightsV1CalculateStatsResponse do
  @moduledoc """
  The response for calculating conversation statistics.

  ## Attributes

  *   `averageDuration` (*type:* `String.t`, *default:* `nil`) - The average duration of all conversations. The average is calculated using only conversations that have a time duration.
  *   `averageTurnCount` (*type:* `integer()`, *default:* `nil`) - The average number of turns per conversation.
  *   `conversationCount` (*type:* `integer()`, *default:* `nil`) - The total number of conversations.
  *   `conversationCountTimeSeries` (*type:* `GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1CalculateStatsResponseTimeSeries.t`, *default:* `nil`) - A time series representing the count of conversations created over time that match that requested filter criteria.
  *   `customHighlighterMatches` (*type:* `map()`, *default:* `nil`) - A map associating each custom highlighter resource name with its respective number of matches in the set of conversations.
  *   `issueMatches` (*type:* `map()`, *default:* `nil`) - A map associating each issue resource name with its respective number of matches in the set of conversations. Key has the format: `projects//locations//issueModels//issues/` Deprecated, use `issue_matches_stats` field instead.
  *   `issueMatchesStats` (*type:* `%{optional(String.t) => GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1IssueModelLabelStatsIssueStats.t}`, *default:* `nil`) - A map associating each issue resource name with its respective number of matches in the set of conversations. Key has the format: `projects//locations//issueModels//issues/`
  *   `smartHighlighterMatches` (*type:* `map()`, *default:* `nil`) - A map associating each smart highlighter display name with its respective number of matches in the set of conversations.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :averageDuration => String.t() | nil,
          :averageTurnCount => integer() | nil,
          :conversationCount => integer() | nil,
          :conversationCountTimeSeries =>
            GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1CalculateStatsResponseTimeSeries.t()
            | nil,
          :customHighlighterMatches => map() | nil,
          :issueMatches => map() | nil,
          :issueMatchesStats =>
            %{
              optional(String.t()) =>
                GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1IssueModelLabelStatsIssueStats.t()
            }
            | nil,
          :smartHighlighterMatches => map() | nil
        }

  field(:averageDuration)
  field(:averageTurnCount)
  field(:conversationCount)

  field(:conversationCountTimeSeries,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1CalculateStatsResponseTimeSeries
  )

  field(:customHighlighterMatches, type: :map)
  field(:issueMatches, type: :map)

  field(:issueMatchesStats,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1IssueModelLabelStatsIssueStats,
    type: :map
  )

  field(:smartHighlighterMatches, type: :map)
end

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

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