{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Kendra.Types.FaqStatistics
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Kendra.Types.FaqStatistics where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Provides statistical information about the FAQ questions and answers
-- contained in an index.
--
-- /See:/ 'newFaqStatistics' smart constructor.
data FaqStatistics = FaqStatistics'
  { -- | The total number of FAQ questions and answers contained in the index.
    FaqStatistics -> Natural
indexedQuestionAnswersCount :: Prelude.Natural
  }
  deriving (FaqStatistics -> FaqStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FaqStatistics -> FaqStatistics -> Bool
$c/= :: FaqStatistics -> FaqStatistics -> Bool
== :: FaqStatistics -> FaqStatistics -> Bool
$c== :: FaqStatistics -> FaqStatistics -> Bool
Prelude.Eq, ReadPrec [FaqStatistics]
ReadPrec FaqStatistics
Int -> ReadS FaqStatistics
ReadS [FaqStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FaqStatistics]
$creadListPrec :: ReadPrec [FaqStatistics]
readPrec :: ReadPrec FaqStatistics
$creadPrec :: ReadPrec FaqStatistics
readList :: ReadS [FaqStatistics]
$creadList :: ReadS [FaqStatistics]
readsPrec :: Int -> ReadS FaqStatistics
$creadsPrec :: Int -> ReadS FaqStatistics
Prelude.Read, Int -> FaqStatistics -> ShowS
[FaqStatistics] -> ShowS
FaqStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FaqStatistics] -> ShowS
$cshowList :: [FaqStatistics] -> ShowS
show :: FaqStatistics -> String
$cshow :: FaqStatistics -> String
showsPrec :: Int -> FaqStatistics -> ShowS
$cshowsPrec :: Int -> FaqStatistics -> ShowS
Prelude.Show, forall x. Rep FaqStatistics x -> FaqStatistics
forall x. FaqStatistics -> Rep FaqStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FaqStatistics x -> FaqStatistics
$cfrom :: forall x. FaqStatistics -> Rep FaqStatistics x
Prelude.Generic)

-- |
-- Create a value of 'FaqStatistics' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'indexedQuestionAnswersCount', 'faqStatistics_indexedQuestionAnswersCount' - The total number of FAQ questions and answers contained in the index.
newFaqStatistics ::
  -- | 'indexedQuestionAnswersCount'
  Prelude.Natural ->
  FaqStatistics
newFaqStatistics :: Natural -> FaqStatistics
newFaqStatistics Natural
pIndexedQuestionAnswersCount_ =
  FaqStatistics'
    { $sel:indexedQuestionAnswersCount:FaqStatistics' :: Natural
indexedQuestionAnswersCount =
        Natural
pIndexedQuestionAnswersCount_
    }

-- | The total number of FAQ questions and answers contained in the index.
faqStatistics_indexedQuestionAnswersCount :: Lens.Lens' FaqStatistics Prelude.Natural
faqStatistics_indexedQuestionAnswersCount :: Lens' FaqStatistics Natural
faqStatistics_indexedQuestionAnswersCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaqStatistics' {Natural
indexedQuestionAnswersCount :: Natural
$sel:indexedQuestionAnswersCount:FaqStatistics' :: FaqStatistics -> Natural
indexedQuestionAnswersCount} -> Natural
indexedQuestionAnswersCount) (\s :: FaqStatistics
s@FaqStatistics' {} Natural
a -> FaqStatistics
s {$sel:indexedQuestionAnswersCount:FaqStatistics' :: Natural
indexedQuestionAnswersCount = Natural
a} :: FaqStatistics)

instance Data.FromJSON FaqStatistics where
  parseJSON :: Value -> Parser FaqStatistics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FaqStatistics"
      ( \Object
x ->
          Natural -> FaqStatistics
FaqStatistics'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"IndexedQuestionAnswersCount")
      )

instance Prelude.Hashable FaqStatistics where
  hashWithSalt :: Int -> FaqStatistics -> Int
hashWithSalt Int
_salt FaqStatistics' {Natural
indexedQuestionAnswersCount :: Natural
$sel:indexedQuestionAnswersCount:FaqStatistics' :: FaqStatistics -> Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
indexedQuestionAnswersCount

instance Prelude.NFData FaqStatistics where
  rnf :: FaqStatistics -> ()
rnf FaqStatistics' {Natural
indexedQuestionAnswersCount :: Natural
$sel:indexedQuestionAnswersCount:FaqStatistics' :: FaqStatistics -> Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Natural
indexedQuestionAnswersCount