{-# 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 #-}
module Amazonka.LexModels.Types.FollowUpPrompt 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.Prompt
import Amazonka.LexModels.Types.Statement
import qualified Amazonka.Prelude as Prelude
data FollowUpPrompt = FollowUpPrompt'
{
FollowUpPrompt -> Prompt
prompt :: Prompt,
FollowUpPrompt -> Statement
rejectionStatement :: Statement
}
deriving (FollowUpPrompt -> FollowUpPrompt -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FollowUpPrompt -> FollowUpPrompt -> Bool
$c/= :: FollowUpPrompt -> FollowUpPrompt -> Bool
== :: FollowUpPrompt -> FollowUpPrompt -> Bool
$c== :: FollowUpPrompt -> FollowUpPrompt -> Bool
Prelude.Eq, ReadPrec [FollowUpPrompt]
ReadPrec FollowUpPrompt
Int -> ReadS FollowUpPrompt
ReadS [FollowUpPrompt]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FollowUpPrompt]
$creadListPrec :: ReadPrec [FollowUpPrompt]
readPrec :: ReadPrec FollowUpPrompt
$creadPrec :: ReadPrec FollowUpPrompt
readList :: ReadS [FollowUpPrompt]
$creadList :: ReadS [FollowUpPrompt]
readsPrec :: Int -> ReadS FollowUpPrompt
$creadsPrec :: Int -> ReadS FollowUpPrompt
Prelude.Read, Int -> FollowUpPrompt -> ShowS
[FollowUpPrompt] -> ShowS
FollowUpPrompt -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FollowUpPrompt] -> ShowS
$cshowList :: [FollowUpPrompt] -> ShowS
show :: FollowUpPrompt -> String
$cshow :: FollowUpPrompt -> String
showsPrec :: Int -> FollowUpPrompt -> ShowS
$cshowsPrec :: Int -> FollowUpPrompt -> ShowS
Prelude.Show, forall x. Rep FollowUpPrompt x -> FollowUpPrompt
forall x. FollowUpPrompt -> Rep FollowUpPrompt x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FollowUpPrompt x -> FollowUpPrompt
$cfrom :: forall x. FollowUpPrompt -> Rep FollowUpPrompt x
Prelude.Generic)
newFollowUpPrompt ::
Prompt ->
Statement ->
FollowUpPrompt
newFollowUpPrompt :: Prompt -> Statement -> FollowUpPrompt
newFollowUpPrompt Prompt
pPrompt_ Statement
pRejectionStatement_ =
FollowUpPrompt'
{ $sel:prompt:FollowUpPrompt' :: Prompt
prompt = Prompt
pPrompt_,
$sel:rejectionStatement:FollowUpPrompt' :: Statement
rejectionStatement = Statement
pRejectionStatement_
}
followUpPrompt_prompt :: Lens.Lens' FollowUpPrompt Prompt
followUpPrompt_prompt :: Lens' FollowUpPrompt Prompt
followUpPrompt_prompt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FollowUpPrompt' {Prompt
prompt :: Prompt
$sel:prompt:FollowUpPrompt' :: FollowUpPrompt -> Prompt
prompt} -> Prompt
prompt) (\s :: FollowUpPrompt
s@FollowUpPrompt' {} Prompt
a -> FollowUpPrompt
s {$sel:prompt:FollowUpPrompt' :: Prompt
prompt = Prompt
a} :: FollowUpPrompt)
followUpPrompt_rejectionStatement :: Lens.Lens' FollowUpPrompt Statement
followUpPrompt_rejectionStatement :: Lens' FollowUpPrompt Statement
followUpPrompt_rejectionStatement = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FollowUpPrompt' {Statement
rejectionStatement :: Statement
$sel:rejectionStatement:FollowUpPrompt' :: FollowUpPrompt -> Statement
rejectionStatement} -> Statement
rejectionStatement) (\s :: FollowUpPrompt
s@FollowUpPrompt' {} Statement
a -> FollowUpPrompt
s {$sel:rejectionStatement:FollowUpPrompt' :: Statement
rejectionStatement = Statement
a} :: FollowUpPrompt)
instance Data.FromJSON FollowUpPrompt where
parseJSON :: Value -> Parser FollowUpPrompt
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FollowUpPrompt"
( \Object
x ->
Prompt -> Statement -> FollowUpPrompt
FollowUpPrompt'
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
"prompt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"rejectionStatement")
)
instance Prelude.Hashable FollowUpPrompt where
hashWithSalt :: Int -> FollowUpPrompt -> Int
hashWithSalt Int
_salt FollowUpPrompt' {Prompt
Statement
rejectionStatement :: Statement
prompt :: Prompt
$sel:rejectionStatement:FollowUpPrompt' :: FollowUpPrompt -> Statement
$sel:prompt:FollowUpPrompt' :: FollowUpPrompt -> Prompt
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Prompt
prompt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Statement
rejectionStatement
instance Prelude.NFData FollowUpPrompt where
rnf :: FollowUpPrompt -> ()
rnf FollowUpPrompt' {Prompt
Statement
rejectionStatement :: Statement
prompt :: Prompt
$sel:rejectionStatement:FollowUpPrompt' :: FollowUpPrompt -> Statement
$sel:prompt:FollowUpPrompt' :: FollowUpPrompt -> Prompt
..} =
forall a. NFData a => a -> ()
Prelude.rnf Prompt
prompt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Statement
rejectionStatement
instance Data.ToJSON FollowUpPrompt where
toJSON :: FollowUpPrompt -> Value
toJSON FollowUpPrompt' {Prompt
Statement
rejectionStatement :: Statement
prompt :: Prompt
$sel:rejectionStatement:FollowUpPrompt' :: FollowUpPrompt -> Statement
$sel:prompt:FollowUpPrompt' :: FollowUpPrompt -> Prompt
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"prompt" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Prompt
prompt),
forall a. a -> Maybe a
Prelude.Just
(Key
"rejectionStatement" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Statement
rejectionStatement)
]
)