{-# 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.LexModels.Types.UtteranceList
-- 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.LexModels.Types.UtteranceList where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexModels.Types.UtteranceData
import qualified Amazonka.Prelude as Prelude

-- | Provides a list of utterances that have been made to a specific version
-- of your bot. The list contains a maximum of 100 utterances.
--
-- /See:/ 'newUtteranceList' smart constructor.
data UtteranceList = UtteranceList'
  { -- | The version of the bot that processed the list.
    UtteranceList -> Maybe Text
botVersion :: Prelude.Maybe Prelude.Text,
    -- | One or more UtteranceData objects that contain information about the
    -- utterances that have been made to a bot. The maximum number of object is
    -- 100.
    UtteranceList -> Maybe [UtteranceData]
utterances :: Prelude.Maybe [UtteranceData]
  }
  deriving (UtteranceList -> UtteranceList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UtteranceList -> UtteranceList -> Bool
$c/= :: UtteranceList -> UtteranceList -> Bool
== :: UtteranceList -> UtteranceList -> Bool
$c== :: UtteranceList -> UtteranceList -> Bool
Prelude.Eq, ReadPrec [UtteranceList]
ReadPrec UtteranceList
Int -> ReadS UtteranceList
ReadS [UtteranceList]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UtteranceList]
$creadListPrec :: ReadPrec [UtteranceList]
readPrec :: ReadPrec UtteranceList
$creadPrec :: ReadPrec UtteranceList
readList :: ReadS [UtteranceList]
$creadList :: ReadS [UtteranceList]
readsPrec :: Int -> ReadS UtteranceList
$creadsPrec :: Int -> ReadS UtteranceList
Prelude.Read, Int -> UtteranceList -> ShowS
[UtteranceList] -> ShowS
UtteranceList -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UtteranceList] -> ShowS
$cshowList :: [UtteranceList] -> ShowS
show :: UtteranceList -> String
$cshow :: UtteranceList -> String
showsPrec :: Int -> UtteranceList -> ShowS
$cshowsPrec :: Int -> UtteranceList -> ShowS
Prelude.Show, forall x. Rep UtteranceList x -> UtteranceList
forall x. UtteranceList -> Rep UtteranceList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UtteranceList x -> UtteranceList
$cfrom :: forall x. UtteranceList -> Rep UtteranceList x
Prelude.Generic)

-- |
-- Create a value of 'UtteranceList' 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:
--
-- 'botVersion', 'utteranceList_botVersion' - The version of the bot that processed the list.
--
-- 'utterances', 'utteranceList_utterances' - One or more UtteranceData objects that contain information about the
-- utterances that have been made to a bot. The maximum number of object is
-- 100.
newUtteranceList ::
  UtteranceList
newUtteranceList :: UtteranceList
newUtteranceList =
  UtteranceList'
    { $sel:botVersion:UtteranceList' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:utterances:UtteranceList' :: Maybe [UtteranceData]
utterances = forall a. Maybe a
Prelude.Nothing
    }

-- | The version of the bot that processed the list.
utteranceList_botVersion :: Lens.Lens' UtteranceList (Prelude.Maybe Prelude.Text)
utteranceList_botVersion :: Lens' UtteranceList (Maybe Text)
utteranceList_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UtteranceList' {Maybe Text
botVersion :: Maybe Text
$sel:botVersion:UtteranceList' :: UtteranceList -> Maybe Text
botVersion} -> Maybe Text
botVersion) (\s :: UtteranceList
s@UtteranceList' {} Maybe Text
a -> UtteranceList
s {$sel:botVersion:UtteranceList' :: Maybe Text
botVersion = Maybe Text
a} :: UtteranceList)

-- | One or more UtteranceData objects that contain information about the
-- utterances that have been made to a bot. The maximum number of object is
-- 100.
utteranceList_utterances :: Lens.Lens' UtteranceList (Prelude.Maybe [UtteranceData])
utteranceList_utterances :: Lens' UtteranceList (Maybe [UtteranceData])
utteranceList_utterances = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UtteranceList' {Maybe [UtteranceData]
utterances :: Maybe [UtteranceData]
$sel:utterances:UtteranceList' :: UtteranceList -> Maybe [UtteranceData]
utterances} -> Maybe [UtteranceData]
utterances) (\s :: UtteranceList
s@UtteranceList' {} Maybe [UtteranceData]
a -> UtteranceList
s {$sel:utterances:UtteranceList' :: Maybe [UtteranceData]
utterances = Maybe [UtteranceData]
a} :: UtteranceList) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON UtteranceList where
  parseJSON :: Value -> Parser UtteranceList
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"UtteranceList"
      ( \Object
x ->
          Maybe Text -> Maybe [UtteranceData] -> UtteranceList
UtteranceList'
            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
"botVersion")
            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
"utterances" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable UtteranceList where
  hashWithSalt :: Int -> UtteranceList -> Int
hashWithSalt Int
_salt UtteranceList' {Maybe [UtteranceData]
Maybe Text
utterances :: Maybe [UtteranceData]
botVersion :: Maybe Text
$sel:utterances:UtteranceList' :: UtteranceList -> Maybe [UtteranceData]
$sel:botVersion:UtteranceList' :: UtteranceList -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
botVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [UtteranceData]
utterances

instance Prelude.NFData UtteranceList where
  rnf :: UtteranceList -> ()
rnf UtteranceList' {Maybe [UtteranceData]
Maybe Text
utterances :: Maybe [UtteranceData]
botVersion :: Maybe Text
$sel:utterances:UtteranceList' :: UtteranceList -> Maybe [UtteranceData]
$sel:botVersion:UtteranceList' :: UtteranceList -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [UtteranceData]
utterances