{-# 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.LambdaCodeHook where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data LambdaCodeHook = LambdaCodeHook'
{
LambdaCodeHook -> Text
lambdaARN :: Prelude.Text,
LambdaCodeHook -> Text
codeHookInterfaceVersion :: Prelude.Text
}
deriving (LambdaCodeHook -> LambdaCodeHook -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaCodeHook -> LambdaCodeHook -> Bool
$c/= :: LambdaCodeHook -> LambdaCodeHook -> Bool
== :: LambdaCodeHook -> LambdaCodeHook -> Bool
$c== :: LambdaCodeHook -> LambdaCodeHook -> Bool
Prelude.Eq, ReadPrec [LambdaCodeHook]
ReadPrec LambdaCodeHook
Int -> ReadS LambdaCodeHook
ReadS [LambdaCodeHook]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaCodeHook]
$creadListPrec :: ReadPrec [LambdaCodeHook]
readPrec :: ReadPrec LambdaCodeHook
$creadPrec :: ReadPrec LambdaCodeHook
readList :: ReadS [LambdaCodeHook]
$creadList :: ReadS [LambdaCodeHook]
readsPrec :: Int -> ReadS LambdaCodeHook
$creadsPrec :: Int -> ReadS LambdaCodeHook
Prelude.Read, Int -> LambdaCodeHook -> ShowS
[LambdaCodeHook] -> ShowS
LambdaCodeHook -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaCodeHook] -> ShowS
$cshowList :: [LambdaCodeHook] -> ShowS
show :: LambdaCodeHook -> String
$cshow :: LambdaCodeHook -> String
showsPrec :: Int -> LambdaCodeHook -> ShowS
$cshowsPrec :: Int -> LambdaCodeHook -> ShowS
Prelude.Show, forall x. Rep LambdaCodeHook x -> LambdaCodeHook
forall x. LambdaCodeHook -> Rep LambdaCodeHook x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LambdaCodeHook x -> LambdaCodeHook
$cfrom :: forall x. LambdaCodeHook -> Rep LambdaCodeHook x
Prelude.Generic)
newLambdaCodeHook ::
Prelude.Text ->
Prelude.Text ->
LambdaCodeHook
newLambdaCodeHook :: Text -> Text -> LambdaCodeHook
newLambdaCodeHook
Text
pLambdaARN_
Text
pCodeHookInterfaceVersion_ =
LambdaCodeHook'
{ $sel:lambdaARN:LambdaCodeHook' :: Text
lambdaARN = Text
pLambdaARN_,
$sel:codeHookInterfaceVersion:LambdaCodeHook' :: Text
codeHookInterfaceVersion =
Text
pCodeHookInterfaceVersion_
}
lambdaCodeHook_lambdaARN :: Lens.Lens' LambdaCodeHook Prelude.Text
lambdaCodeHook_lambdaARN :: Lens' LambdaCodeHook Text
lambdaCodeHook_lambdaARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaCodeHook' {Text
lambdaARN :: Text
$sel:lambdaARN:LambdaCodeHook' :: LambdaCodeHook -> Text
lambdaARN} -> Text
lambdaARN) (\s :: LambdaCodeHook
s@LambdaCodeHook' {} Text
a -> LambdaCodeHook
s {$sel:lambdaARN:LambdaCodeHook' :: Text
lambdaARN = Text
a} :: LambdaCodeHook)
lambdaCodeHook_codeHookInterfaceVersion :: Lens.Lens' LambdaCodeHook Prelude.Text
lambdaCodeHook_codeHookInterfaceVersion :: Lens' LambdaCodeHook Text
lambdaCodeHook_codeHookInterfaceVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaCodeHook' {Text
codeHookInterfaceVersion :: Text
$sel:codeHookInterfaceVersion:LambdaCodeHook' :: LambdaCodeHook -> Text
codeHookInterfaceVersion} -> Text
codeHookInterfaceVersion) (\s :: LambdaCodeHook
s@LambdaCodeHook' {} Text
a -> LambdaCodeHook
s {$sel:codeHookInterfaceVersion:LambdaCodeHook' :: Text
codeHookInterfaceVersion = Text
a} :: LambdaCodeHook)
instance Data.FromJSON LambdaCodeHook where
parseJSON :: Value -> Parser LambdaCodeHook
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"LambdaCodeHook"
( \Object
x ->
Text -> Text -> LambdaCodeHook
LambdaCodeHook'
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
"lambdaARN")
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
"codeHookInterfaceVersion")
)
instance Prelude.Hashable LambdaCodeHook where
hashWithSalt :: Int -> LambdaCodeHook -> Int
hashWithSalt Int
_salt LambdaCodeHook' {Text
codeHookInterfaceVersion :: Text
lambdaARN :: Text
$sel:codeHookInterfaceVersion:LambdaCodeHook' :: LambdaCodeHook -> Text
$sel:lambdaARN:LambdaCodeHook' :: LambdaCodeHook -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lambdaARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
codeHookInterfaceVersion
instance Prelude.NFData LambdaCodeHook where
rnf :: LambdaCodeHook -> ()
rnf LambdaCodeHook' {Text
codeHookInterfaceVersion :: Text
lambdaARN :: Text
$sel:codeHookInterfaceVersion:LambdaCodeHook' :: LambdaCodeHook -> Text
$sel:lambdaARN:LambdaCodeHook' :: LambdaCodeHook -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
lambdaARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
codeHookInterfaceVersion
instance Data.ToJSON LambdaCodeHook where
toJSON :: LambdaCodeHook -> Value
toJSON LambdaCodeHook' {Text
codeHookInterfaceVersion :: Text
lambdaARN :: Text
$sel:codeHookInterfaceVersion:LambdaCodeHook' :: LambdaCodeHook -> Text
$sel:lambdaARN:LambdaCodeHook' :: LambdaCodeHook -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"lambdaARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
lambdaARN),
forall a. a -> Maybe a
Prelude.Just
( Key
"codeHookInterfaceVersion"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
codeHookInterfaceVersion
)
]
)