{-# 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.LexV2Models.Types.IntentClosingSetting 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.ConditionalSpecification
import Amazonka.LexV2Models.Types.DialogState
import Amazonka.LexV2Models.Types.ResponseSpecification
import qualified Amazonka.Prelude as Prelude
data IntentClosingSetting = IntentClosingSetting'
{
IntentClosingSetting -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
IntentClosingSetting -> Maybe ResponseSpecification
closingResponse :: Prelude.Maybe ResponseSpecification,
IntentClosingSetting -> Maybe ConditionalSpecification
conditional :: Prelude.Maybe ConditionalSpecification,
IntentClosingSetting -> Maybe DialogState
nextStep :: Prelude.Maybe DialogState
}
deriving (IntentClosingSetting -> IntentClosingSetting -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IntentClosingSetting -> IntentClosingSetting -> Bool
$c/= :: IntentClosingSetting -> IntentClosingSetting -> Bool
== :: IntentClosingSetting -> IntentClosingSetting -> Bool
$c== :: IntentClosingSetting -> IntentClosingSetting -> Bool
Prelude.Eq, ReadPrec [IntentClosingSetting]
ReadPrec IntentClosingSetting
Int -> ReadS IntentClosingSetting
ReadS [IntentClosingSetting]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IntentClosingSetting]
$creadListPrec :: ReadPrec [IntentClosingSetting]
readPrec :: ReadPrec IntentClosingSetting
$creadPrec :: ReadPrec IntentClosingSetting
readList :: ReadS [IntentClosingSetting]
$creadList :: ReadS [IntentClosingSetting]
readsPrec :: Int -> ReadS IntentClosingSetting
$creadsPrec :: Int -> ReadS IntentClosingSetting
Prelude.Read, Int -> IntentClosingSetting -> ShowS
[IntentClosingSetting] -> ShowS
IntentClosingSetting -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IntentClosingSetting] -> ShowS
$cshowList :: [IntentClosingSetting] -> ShowS
show :: IntentClosingSetting -> String
$cshow :: IntentClosingSetting -> String
showsPrec :: Int -> IntentClosingSetting -> ShowS
$cshowsPrec :: Int -> IntentClosingSetting -> ShowS
Prelude.Show, forall x. Rep IntentClosingSetting x -> IntentClosingSetting
forall x. IntentClosingSetting -> Rep IntentClosingSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IntentClosingSetting x -> IntentClosingSetting
$cfrom :: forall x. IntentClosingSetting -> Rep IntentClosingSetting x
Prelude.Generic)
newIntentClosingSetting ::
IntentClosingSetting
newIntentClosingSetting :: IntentClosingSetting
newIntentClosingSetting =
IntentClosingSetting'
{ $sel:active:IntentClosingSetting' :: Maybe Bool
active = forall a. Maybe a
Prelude.Nothing,
$sel:closingResponse:IntentClosingSetting' :: Maybe ResponseSpecification
closingResponse = forall a. Maybe a
Prelude.Nothing,
$sel:conditional:IntentClosingSetting' :: Maybe ConditionalSpecification
conditional = forall a. Maybe a
Prelude.Nothing,
$sel:nextStep:IntentClosingSetting' :: Maybe DialogState
nextStep = forall a. Maybe a
Prelude.Nothing
}
intentClosingSetting_active :: Lens.Lens' IntentClosingSetting (Prelude.Maybe Prelude.Bool)
intentClosingSetting_active :: Lens' IntentClosingSetting (Maybe Bool)
intentClosingSetting_active = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentClosingSetting' {Maybe Bool
active :: Maybe Bool
$sel:active:IntentClosingSetting' :: IntentClosingSetting -> Maybe Bool
active} -> Maybe Bool
active) (\s :: IntentClosingSetting
s@IntentClosingSetting' {} Maybe Bool
a -> IntentClosingSetting
s {$sel:active:IntentClosingSetting' :: Maybe Bool
active = Maybe Bool
a} :: IntentClosingSetting)
intentClosingSetting_closingResponse :: Lens.Lens' IntentClosingSetting (Prelude.Maybe ResponseSpecification)
intentClosingSetting_closingResponse :: Lens' IntentClosingSetting (Maybe ResponseSpecification)
intentClosingSetting_closingResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentClosingSetting' {Maybe ResponseSpecification
closingResponse :: Maybe ResponseSpecification
$sel:closingResponse:IntentClosingSetting' :: IntentClosingSetting -> Maybe ResponseSpecification
closingResponse} -> Maybe ResponseSpecification
closingResponse) (\s :: IntentClosingSetting
s@IntentClosingSetting' {} Maybe ResponseSpecification
a -> IntentClosingSetting
s {$sel:closingResponse:IntentClosingSetting' :: Maybe ResponseSpecification
closingResponse = Maybe ResponseSpecification
a} :: IntentClosingSetting)
intentClosingSetting_conditional :: Lens.Lens' IntentClosingSetting (Prelude.Maybe ConditionalSpecification)
intentClosingSetting_conditional :: Lens' IntentClosingSetting (Maybe ConditionalSpecification)
intentClosingSetting_conditional = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentClosingSetting' {Maybe ConditionalSpecification
conditional :: Maybe ConditionalSpecification
$sel:conditional:IntentClosingSetting' :: IntentClosingSetting -> Maybe ConditionalSpecification
conditional} -> Maybe ConditionalSpecification
conditional) (\s :: IntentClosingSetting
s@IntentClosingSetting' {} Maybe ConditionalSpecification
a -> IntentClosingSetting
s {$sel:conditional:IntentClosingSetting' :: Maybe ConditionalSpecification
conditional = Maybe ConditionalSpecification
a} :: IntentClosingSetting)
intentClosingSetting_nextStep :: Lens.Lens' IntentClosingSetting (Prelude.Maybe DialogState)
intentClosingSetting_nextStep :: Lens' IntentClosingSetting (Maybe DialogState)
intentClosingSetting_nextStep = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntentClosingSetting' {Maybe DialogState
nextStep :: Maybe DialogState
$sel:nextStep:IntentClosingSetting' :: IntentClosingSetting -> Maybe DialogState
nextStep} -> Maybe DialogState
nextStep) (\s :: IntentClosingSetting
s@IntentClosingSetting' {} Maybe DialogState
a -> IntentClosingSetting
s {$sel:nextStep:IntentClosingSetting' :: Maybe DialogState
nextStep = Maybe DialogState
a} :: IntentClosingSetting)
instance Data.FromJSON IntentClosingSetting where
parseJSON :: Value -> Parser IntentClosingSetting
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"IntentClosingSetting"
( \Object
x ->
Maybe Bool
-> Maybe ResponseSpecification
-> Maybe ConditionalSpecification
-> Maybe DialogState
-> IntentClosingSetting
IntentClosingSetting'
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
"active")
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
"closingResponse")
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
"conditional")
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
"nextStep")
)
instance Prelude.Hashable IntentClosingSetting where
hashWithSalt :: Int -> IntentClosingSetting -> Int
hashWithSalt Int
_salt IntentClosingSetting' {Maybe Bool
Maybe ResponseSpecification
Maybe DialogState
Maybe ConditionalSpecification
nextStep :: Maybe DialogState
conditional :: Maybe ConditionalSpecification
closingResponse :: Maybe ResponseSpecification
active :: Maybe Bool
$sel:nextStep:IntentClosingSetting' :: IntentClosingSetting -> Maybe DialogState
$sel:conditional:IntentClosingSetting' :: IntentClosingSetting -> Maybe ConditionalSpecification
$sel:closingResponse:IntentClosingSetting' :: IntentClosingSetting -> Maybe ResponseSpecification
$sel:active:IntentClosingSetting' :: IntentClosingSetting -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
active
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResponseSpecification
closingResponse
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConditionalSpecification
conditional
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DialogState
nextStep
instance Prelude.NFData IntentClosingSetting where
rnf :: IntentClosingSetting -> ()
rnf IntentClosingSetting' {Maybe Bool
Maybe ResponseSpecification
Maybe DialogState
Maybe ConditionalSpecification
nextStep :: Maybe DialogState
conditional :: Maybe ConditionalSpecification
closingResponse :: Maybe ResponseSpecification
active :: Maybe Bool
$sel:nextStep:IntentClosingSetting' :: IntentClosingSetting -> Maybe DialogState
$sel:conditional:IntentClosingSetting' :: IntentClosingSetting -> Maybe ConditionalSpecification
$sel:closingResponse:IntentClosingSetting' :: IntentClosingSetting -> Maybe ResponseSpecification
$sel:active:IntentClosingSetting' :: IntentClosingSetting -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
active
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResponseSpecification
closingResponse
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConditionalSpecification
conditional
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DialogState
nextStep
instance Data.ToJSON IntentClosingSetting where
toJSON :: IntentClosingSetting -> Value
toJSON IntentClosingSetting' {Maybe Bool
Maybe ResponseSpecification
Maybe DialogState
Maybe ConditionalSpecification
nextStep :: Maybe DialogState
conditional :: Maybe ConditionalSpecification
closingResponse :: Maybe ResponseSpecification
active :: Maybe Bool
$sel:nextStep:IntentClosingSetting' :: IntentClosingSetting -> Maybe DialogState
$sel:conditional:IntentClosingSetting' :: IntentClosingSetting -> Maybe ConditionalSpecification
$sel:closingResponse:IntentClosingSetting' :: IntentClosingSetting -> Maybe ResponseSpecification
$sel:active:IntentClosingSetting' :: IntentClosingSetting -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"active" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
active,
(Key
"closingResponse" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResponseSpecification
closingResponse,
(Key
"conditional" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConditionalSpecification
conditional,
(Key
"nextStep" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DialogState
nextStep
]
)