{-# 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.LexV2Models.Types.BotRecommendationResultStatistics
-- 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.LexV2Models.Types.BotRecommendationResultStatistics where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types.IntentStatistics
import Amazonka.LexV2Models.Types.SlotTypeStatistics
import qualified Amazonka.Prelude as Prelude

-- | A statistical summary of the bot recommendation results.
--
-- /See:/ 'newBotRecommendationResultStatistics' smart constructor.
data BotRecommendationResultStatistics = BotRecommendationResultStatistics'
  { -- | Statistical information about about the intents associated with the bot
    -- recommendation results.
    BotRecommendationResultStatistics -> Maybe IntentStatistics
intents :: Prelude.Maybe IntentStatistics,
    -- | Statistical information about the slot types associated with the bot
    -- recommendation results.
    BotRecommendationResultStatistics -> Maybe SlotTypeStatistics
slotTypes :: Prelude.Maybe SlotTypeStatistics
  }
  deriving (BotRecommendationResultStatistics
-> BotRecommendationResultStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BotRecommendationResultStatistics
-> BotRecommendationResultStatistics -> Bool
$c/= :: BotRecommendationResultStatistics
-> BotRecommendationResultStatistics -> Bool
== :: BotRecommendationResultStatistics
-> BotRecommendationResultStatistics -> Bool
$c== :: BotRecommendationResultStatistics
-> BotRecommendationResultStatistics -> Bool
Prelude.Eq, ReadPrec [BotRecommendationResultStatistics]
ReadPrec BotRecommendationResultStatistics
Int -> ReadS BotRecommendationResultStatistics
ReadS [BotRecommendationResultStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BotRecommendationResultStatistics]
$creadListPrec :: ReadPrec [BotRecommendationResultStatistics]
readPrec :: ReadPrec BotRecommendationResultStatistics
$creadPrec :: ReadPrec BotRecommendationResultStatistics
readList :: ReadS [BotRecommendationResultStatistics]
$creadList :: ReadS [BotRecommendationResultStatistics]
readsPrec :: Int -> ReadS BotRecommendationResultStatistics
$creadsPrec :: Int -> ReadS BotRecommendationResultStatistics
Prelude.Read, Int -> BotRecommendationResultStatistics -> ShowS
[BotRecommendationResultStatistics] -> ShowS
BotRecommendationResultStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotRecommendationResultStatistics] -> ShowS
$cshowList :: [BotRecommendationResultStatistics] -> ShowS
show :: BotRecommendationResultStatistics -> String
$cshow :: BotRecommendationResultStatistics -> String
showsPrec :: Int -> BotRecommendationResultStatistics -> ShowS
$cshowsPrec :: Int -> BotRecommendationResultStatistics -> ShowS
Prelude.Show, forall x.
Rep BotRecommendationResultStatistics x
-> BotRecommendationResultStatistics
forall x.
BotRecommendationResultStatistics
-> Rep BotRecommendationResultStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BotRecommendationResultStatistics x
-> BotRecommendationResultStatistics
$cfrom :: forall x.
BotRecommendationResultStatistics
-> Rep BotRecommendationResultStatistics x
Prelude.Generic)

-- |
-- Create a value of 'BotRecommendationResultStatistics' 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:
--
-- 'intents', 'botRecommendationResultStatistics_intents' - Statistical information about about the intents associated with the bot
-- recommendation results.
--
-- 'slotTypes', 'botRecommendationResultStatistics_slotTypes' - Statistical information about the slot types associated with the bot
-- recommendation results.
newBotRecommendationResultStatistics ::
  BotRecommendationResultStatistics
newBotRecommendationResultStatistics :: BotRecommendationResultStatistics
newBotRecommendationResultStatistics =
  BotRecommendationResultStatistics'
    { $sel:intents:BotRecommendationResultStatistics' :: Maybe IntentStatistics
intents =
        forall a. Maybe a
Prelude.Nothing,
      $sel:slotTypes:BotRecommendationResultStatistics' :: Maybe SlotTypeStatistics
slotTypes = forall a. Maybe a
Prelude.Nothing
    }

-- | Statistical information about about the intents associated with the bot
-- recommendation results.
botRecommendationResultStatistics_intents :: Lens.Lens' BotRecommendationResultStatistics (Prelude.Maybe IntentStatistics)
botRecommendationResultStatistics_intents :: Lens' BotRecommendationResultStatistics (Maybe IntentStatistics)
botRecommendationResultStatistics_intents = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotRecommendationResultStatistics' {Maybe IntentStatistics
intents :: Maybe IntentStatistics
$sel:intents:BotRecommendationResultStatistics' :: BotRecommendationResultStatistics -> Maybe IntentStatistics
intents} -> Maybe IntentStatistics
intents) (\s :: BotRecommendationResultStatistics
s@BotRecommendationResultStatistics' {} Maybe IntentStatistics
a -> BotRecommendationResultStatistics
s {$sel:intents:BotRecommendationResultStatistics' :: Maybe IntentStatistics
intents = Maybe IntentStatistics
a} :: BotRecommendationResultStatistics)

-- | Statistical information about the slot types associated with the bot
-- recommendation results.
botRecommendationResultStatistics_slotTypes :: Lens.Lens' BotRecommendationResultStatistics (Prelude.Maybe SlotTypeStatistics)
botRecommendationResultStatistics_slotTypes :: Lens' BotRecommendationResultStatistics (Maybe SlotTypeStatistics)
botRecommendationResultStatistics_slotTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotRecommendationResultStatistics' {Maybe SlotTypeStatistics
slotTypes :: Maybe SlotTypeStatistics
$sel:slotTypes:BotRecommendationResultStatistics' :: BotRecommendationResultStatistics -> Maybe SlotTypeStatistics
slotTypes} -> Maybe SlotTypeStatistics
slotTypes) (\s :: BotRecommendationResultStatistics
s@BotRecommendationResultStatistics' {} Maybe SlotTypeStatistics
a -> BotRecommendationResultStatistics
s {$sel:slotTypes:BotRecommendationResultStatistics' :: Maybe SlotTypeStatistics
slotTypes = Maybe SlotTypeStatistics
a} :: BotRecommendationResultStatistics)

instance
  Data.FromJSON
    BotRecommendationResultStatistics
  where
  parseJSON :: Value -> Parser BotRecommendationResultStatistics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BotRecommendationResultStatistics"
      ( \Object
x ->
          Maybe IntentStatistics
-> Maybe SlotTypeStatistics -> BotRecommendationResultStatistics
BotRecommendationResultStatistics'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"intents")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"slotTypes")
      )

instance
  Prelude.Hashable
    BotRecommendationResultStatistics
  where
  hashWithSalt :: Int -> BotRecommendationResultStatistics -> Int
hashWithSalt
    Int
_salt
    BotRecommendationResultStatistics' {Maybe IntentStatistics
Maybe SlotTypeStatistics
slotTypes :: Maybe SlotTypeStatistics
intents :: Maybe IntentStatistics
$sel:slotTypes:BotRecommendationResultStatistics' :: BotRecommendationResultStatistics -> Maybe SlotTypeStatistics
$sel:intents:BotRecommendationResultStatistics' :: BotRecommendationResultStatistics -> Maybe IntentStatistics
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IntentStatistics
intents
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SlotTypeStatistics
slotTypes

instance
  Prelude.NFData
    BotRecommendationResultStatistics
  where
  rnf :: BotRecommendationResultStatistics -> ()
rnf BotRecommendationResultStatistics' {Maybe IntentStatistics
Maybe SlotTypeStatistics
slotTypes :: Maybe SlotTypeStatistics
intents :: Maybe IntentStatistics
$sel:slotTypes:BotRecommendationResultStatistics' :: BotRecommendationResultStatistics -> Maybe SlotTypeStatistics
$sel:intents:BotRecommendationResultStatistics' :: BotRecommendationResultStatistics -> Maybe IntentStatistics
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe IntentStatistics
intents
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SlotTypeStatistics
slotTypes