{-# 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.FulfillmentCodeHookSettings 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.FulfillmentUpdatesSpecification
import Amazonka.LexV2Models.Types.PostFulfillmentStatusSpecification
import qualified Amazonka.Prelude as Prelude
data FulfillmentCodeHookSettings = FulfillmentCodeHookSettings'
{
FulfillmentCodeHookSettings -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
FulfillmentCodeHookSettings
-> Maybe FulfillmentUpdatesSpecification
fulfillmentUpdatesSpecification :: Prelude.Maybe FulfillmentUpdatesSpecification,
FulfillmentCodeHookSettings
-> Maybe PostFulfillmentStatusSpecification
postFulfillmentStatusSpecification :: Prelude.Maybe PostFulfillmentStatusSpecification,
FulfillmentCodeHookSettings -> Bool
enabled :: Prelude.Bool
}
deriving (FulfillmentCodeHookSettings -> FulfillmentCodeHookSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FulfillmentCodeHookSettings -> FulfillmentCodeHookSettings -> Bool
$c/= :: FulfillmentCodeHookSettings -> FulfillmentCodeHookSettings -> Bool
== :: FulfillmentCodeHookSettings -> FulfillmentCodeHookSettings -> Bool
$c== :: FulfillmentCodeHookSettings -> FulfillmentCodeHookSettings -> Bool
Prelude.Eq, ReadPrec [FulfillmentCodeHookSettings]
ReadPrec FulfillmentCodeHookSettings
Int -> ReadS FulfillmentCodeHookSettings
ReadS [FulfillmentCodeHookSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FulfillmentCodeHookSettings]
$creadListPrec :: ReadPrec [FulfillmentCodeHookSettings]
readPrec :: ReadPrec FulfillmentCodeHookSettings
$creadPrec :: ReadPrec FulfillmentCodeHookSettings
readList :: ReadS [FulfillmentCodeHookSettings]
$creadList :: ReadS [FulfillmentCodeHookSettings]
readsPrec :: Int -> ReadS FulfillmentCodeHookSettings
$creadsPrec :: Int -> ReadS FulfillmentCodeHookSettings
Prelude.Read, Int -> FulfillmentCodeHookSettings -> ShowS
[FulfillmentCodeHookSettings] -> ShowS
FulfillmentCodeHookSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FulfillmentCodeHookSettings] -> ShowS
$cshowList :: [FulfillmentCodeHookSettings] -> ShowS
show :: FulfillmentCodeHookSettings -> String
$cshow :: FulfillmentCodeHookSettings -> String
showsPrec :: Int -> FulfillmentCodeHookSettings -> ShowS
$cshowsPrec :: Int -> FulfillmentCodeHookSettings -> ShowS
Prelude.Show, forall x.
Rep FulfillmentCodeHookSettings x -> FulfillmentCodeHookSettings
forall x.
FulfillmentCodeHookSettings -> Rep FulfillmentCodeHookSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FulfillmentCodeHookSettings x -> FulfillmentCodeHookSettings
$cfrom :: forall x.
FulfillmentCodeHookSettings -> Rep FulfillmentCodeHookSettings x
Prelude.Generic)
newFulfillmentCodeHookSettings ::
Prelude.Bool ->
FulfillmentCodeHookSettings
newFulfillmentCodeHookSettings :: Bool -> FulfillmentCodeHookSettings
newFulfillmentCodeHookSettings Bool
pEnabled_ =
FulfillmentCodeHookSettings'
{ $sel:active:FulfillmentCodeHookSettings' :: Maybe Bool
active =
forall a. Maybe a
Prelude.Nothing,
$sel:fulfillmentUpdatesSpecification:FulfillmentCodeHookSettings' :: Maybe FulfillmentUpdatesSpecification
fulfillmentUpdatesSpecification =
forall a. Maybe a
Prelude.Nothing,
$sel:postFulfillmentStatusSpecification:FulfillmentCodeHookSettings' :: Maybe PostFulfillmentStatusSpecification
postFulfillmentStatusSpecification =
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:FulfillmentCodeHookSettings' :: Bool
enabled = Bool
pEnabled_
}
fulfillmentCodeHookSettings_active :: Lens.Lens' FulfillmentCodeHookSettings (Prelude.Maybe Prelude.Bool)
fulfillmentCodeHookSettings_active :: Lens' FulfillmentCodeHookSettings (Maybe Bool)
fulfillmentCodeHookSettings_active = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FulfillmentCodeHookSettings' {Maybe Bool
active :: Maybe Bool
$sel:active:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings -> Maybe Bool
active} -> Maybe Bool
active) (\s :: FulfillmentCodeHookSettings
s@FulfillmentCodeHookSettings' {} Maybe Bool
a -> FulfillmentCodeHookSettings
s {$sel:active:FulfillmentCodeHookSettings' :: Maybe Bool
active = Maybe Bool
a} :: FulfillmentCodeHookSettings)
fulfillmentCodeHookSettings_fulfillmentUpdatesSpecification :: Lens.Lens' FulfillmentCodeHookSettings (Prelude.Maybe FulfillmentUpdatesSpecification)
fulfillmentCodeHookSettings_fulfillmentUpdatesSpecification :: Lens'
FulfillmentCodeHookSettings (Maybe FulfillmentUpdatesSpecification)
fulfillmentCodeHookSettings_fulfillmentUpdatesSpecification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FulfillmentCodeHookSettings' {Maybe FulfillmentUpdatesSpecification
fulfillmentUpdatesSpecification :: Maybe FulfillmentUpdatesSpecification
$sel:fulfillmentUpdatesSpecification:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings
-> Maybe FulfillmentUpdatesSpecification
fulfillmentUpdatesSpecification} -> Maybe FulfillmentUpdatesSpecification
fulfillmentUpdatesSpecification) (\s :: FulfillmentCodeHookSettings
s@FulfillmentCodeHookSettings' {} Maybe FulfillmentUpdatesSpecification
a -> FulfillmentCodeHookSettings
s {$sel:fulfillmentUpdatesSpecification:FulfillmentCodeHookSettings' :: Maybe FulfillmentUpdatesSpecification
fulfillmentUpdatesSpecification = Maybe FulfillmentUpdatesSpecification
a} :: FulfillmentCodeHookSettings)
fulfillmentCodeHookSettings_postFulfillmentStatusSpecification :: Lens.Lens' FulfillmentCodeHookSettings (Prelude.Maybe PostFulfillmentStatusSpecification)
fulfillmentCodeHookSettings_postFulfillmentStatusSpecification :: Lens'
FulfillmentCodeHookSettings
(Maybe PostFulfillmentStatusSpecification)
fulfillmentCodeHookSettings_postFulfillmentStatusSpecification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FulfillmentCodeHookSettings' {Maybe PostFulfillmentStatusSpecification
postFulfillmentStatusSpecification :: Maybe PostFulfillmentStatusSpecification
$sel:postFulfillmentStatusSpecification:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings
-> Maybe PostFulfillmentStatusSpecification
postFulfillmentStatusSpecification} -> Maybe PostFulfillmentStatusSpecification
postFulfillmentStatusSpecification) (\s :: FulfillmentCodeHookSettings
s@FulfillmentCodeHookSettings' {} Maybe PostFulfillmentStatusSpecification
a -> FulfillmentCodeHookSettings
s {$sel:postFulfillmentStatusSpecification:FulfillmentCodeHookSettings' :: Maybe PostFulfillmentStatusSpecification
postFulfillmentStatusSpecification = Maybe PostFulfillmentStatusSpecification
a} :: FulfillmentCodeHookSettings)
fulfillmentCodeHookSettings_enabled :: Lens.Lens' FulfillmentCodeHookSettings Prelude.Bool
fulfillmentCodeHookSettings_enabled :: Lens' FulfillmentCodeHookSettings Bool
fulfillmentCodeHookSettings_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FulfillmentCodeHookSettings' {Bool
enabled :: Bool
$sel:enabled:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings -> Bool
enabled} -> Bool
enabled) (\s :: FulfillmentCodeHookSettings
s@FulfillmentCodeHookSettings' {} Bool
a -> FulfillmentCodeHookSettings
s {$sel:enabled:FulfillmentCodeHookSettings' :: Bool
enabled = Bool
a} :: FulfillmentCodeHookSettings)
instance Data.FromJSON FulfillmentCodeHookSettings where
parseJSON :: Value -> Parser FulfillmentCodeHookSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FulfillmentCodeHookSettings"
( \Object
x ->
Maybe Bool
-> Maybe FulfillmentUpdatesSpecification
-> Maybe PostFulfillmentStatusSpecification
-> Bool
-> FulfillmentCodeHookSettings
FulfillmentCodeHookSettings'
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
"fulfillmentUpdatesSpecification")
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
"postFulfillmentStatusSpecification")
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
"enabled")
)
instance Prelude.Hashable FulfillmentCodeHookSettings where
hashWithSalt :: Int -> FulfillmentCodeHookSettings -> Int
hashWithSalt Int
_salt FulfillmentCodeHookSettings' {Bool
Maybe Bool
Maybe FulfillmentUpdatesSpecification
Maybe PostFulfillmentStatusSpecification
enabled :: Bool
postFulfillmentStatusSpecification :: Maybe PostFulfillmentStatusSpecification
fulfillmentUpdatesSpecification :: Maybe FulfillmentUpdatesSpecification
active :: Maybe Bool
$sel:enabled:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings -> Bool
$sel:postFulfillmentStatusSpecification:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings
-> Maybe PostFulfillmentStatusSpecification
$sel:fulfillmentUpdatesSpecification:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings
-> Maybe FulfillmentUpdatesSpecification
$sel:active:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings -> 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 FulfillmentUpdatesSpecification
fulfillmentUpdatesSpecification
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PostFulfillmentStatusSpecification
postFulfillmentStatusSpecification
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enabled
instance Prelude.NFData FulfillmentCodeHookSettings where
rnf :: FulfillmentCodeHookSettings -> ()
rnf FulfillmentCodeHookSettings' {Bool
Maybe Bool
Maybe FulfillmentUpdatesSpecification
Maybe PostFulfillmentStatusSpecification
enabled :: Bool
postFulfillmentStatusSpecification :: Maybe PostFulfillmentStatusSpecification
fulfillmentUpdatesSpecification :: Maybe FulfillmentUpdatesSpecification
active :: Maybe Bool
$sel:enabled:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings -> Bool
$sel:postFulfillmentStatusSpecification:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings
-> Maybe PostFulfillmentStatusSpecification
$sel:fulfillmentUpdatesSpecification:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings
-> Maybe FulfillmentUpdatesSpecification
$sel:active:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings -> 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 FulfillmentUpdatesSpecification
fulfillmentUpdatesSpecification
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PostFulfillmentStatusSpecification
postFulfillmentStatusSpecification
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
enabled
instance Data.ToJSON FulfillmentCodeHookSettings where
toJSON :: FulfillmentCodeHookSettings -> Value
toJSON FulfillmentCodeHookSettings' {Bool
Maybe Bool
Maybe FulfillmentUpdatesSpecification
Maybe PostFulfillmentStatusSpecification
enabled :: Bool
postFulfillmentStatusSpecification :: Maybe PostFulfillmentStatusSpecification
fulfillmentUpdatesSpecification :: Maybe FulfillmentUpdatesSpecification
active :: Maybe Bool
$sel:enabled:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings -> Bool
$sel:postFulfillmentStatusSpecification:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings
-> Maybe PostFulfillmentStatusSpecification
$sel:fulfillmentUpdatesSpecification:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings
-> Maybe FulfillmentUpdatesSpecification
$sel:active:FulfillmentCodeHookSettings' :: FulfillmentCodeHookSettings -> 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
"fulfillmentUpdatesSpecification" 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 FulfillmentUpdatesSpecification
fulfillmentUpdatesSpecification,
(Key
"postFulfillmentStatusSpecification" 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 PostFulfillmentStatusSpecification
postFulfillmentStatusSpecification,
forall a. a -> Maybe a
Prelude.Just (Key
"enabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
enabled)
]
)