{-# 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.AppSync.Types.LambdaDataSourceConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LambdaDataSourceConfig = LambdaDataSourceConfig'
{
LambdaDataSourceConfig -> Text
lambdaFunctionArn :: Prelude.Text
}
deriving (LambdaDataSourceConfig -> LambdaDataSourceConfig -> Bool
(LambdaDataSourceConfig -> LambdaDataSourceConfig -> Bool)
-> (LambdaDataSourceConfig -> LambdaDataSourceConfig -> Bool)
-> Eq LambdaDataSourceConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaDataSourceConfig -> LambdaDataSourceConfig -> Bool
$c/= :: LambdaDataSourceConfig -> LambdaDataSourceConfig -> Bool
== :: LambdaDataSourceConfig -> LambdaDataSourceConfig -> Bool
$c== :: LambdaDataSourceConfig -> LambdaDataSourceConfig -> Bool
Prelude.Eq, ReadPrec [LambdaDataSourceConfig]
ReadPrec LambdaDataSourceConfig
Int -> ReadS LambdaDataSourceConfig
ReadS [LambdaDataSourceConfig]
(Int -> ReadS LambdaDataSourceConfig)
-> ReadS [LambdaDataSourceConfig]
-> ReadPrec LambdaDataSourceConfig
-> ReadPrec [LambdaDataSourceConfig]
-> Read LambdaDataSourceConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaDataSourceConfig]
$creadListPrec :: ReadPrec [LambdaDataSourceConfig]
readPrec :: ReadPrec LambdaDataSourceConfig
$creadPrec :: ReadPrec LambdaDataSourceConfig
readList :: ReadS [LambdaDataSourceConfig]
$creadList :: ReadS [LambdaDataSourceConfig]
readsPrec :: Int -> ReadS LambdaDataSourceConfig
$creadsPrec :: Int -> ReadS LambdaDataSourceConfig
Prelude.Read, Int -> LambdaDataSourceConfig -> ShowS
[LambdaDataSourceConfig] -> ShowS
LambdaDataSourceConfig -> String
(Int -> LambdaDataSourceConfig -> ShowS)
-> (LambdaDataSourceConfig -> String)
-> ([LambdaDataSourceConfig] -> ShowS)
-> Show LambdaDataSourceConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaDataSourceConfig] -> ShowS
$cshowList :: [LambdaDataSourceConfig] -> ShowS
show :: LambdaDataSourceConfig -> String
$cshow :: LambdaDataSourceConfig -> String
showsPrec :: Int -> LambdaDataSourceConfig -> ShowS
$cshowsPrec :: Int -> LambdaDataSourceConfig -> ShowS
Prelude.Show, (forall x. LambdaDataSourceConfig -> Rep LambdaDataSourceConfig x)
-> (forall x.
Rep LambdaDataSourceConfig x -> LambdaDataSourceConfig)
-> Generic LambdaDataSourceConfig
forall x. Rep LambdaDataSourceConfig x -> LambdaDataSourceConfig
forall x. LambdaDataSourceConfig -> Rep LambdaDataSourceConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LambdaDataSourceConfig x -> LambdaDataSourceConfig
$cfrom :: forall x. LambdaDataSourceConfig -> Rep LambdaDataSourceConfig x
Prelude.Generic)
newLambdaDataSourceConfig ::
Prelude.Text ->
LambdaDataSourceConfig
newLambdaDataSourceConfig :: Text -> LambdaDataSourceConfig
newLambdaDataSourceConfig Text
pLambdaFunctionArn_ =
LambdaDataSourceConfig' :: Text -> LambdaDataSourceConfig
LambdaDataSourceConfig'
{ $sel:lambdaFunctionArn:LambdaDataSourceConfig' :: Text
lambdaFunctionArn =
Text
pLambdaFunctionArn_
}
lambdaDataSourceConfig_lambdaFunctionArn :: Lens.Lens' LambdaDataSourceConfig Prelude.Text
lambdaDataSourceConfig_lambdaFunctionArn :: (Text -> f Text)
-> LambdaDataSourceConfig -> f LambdaDataSourceConfig
lambdaDataSourceConfig_lambdaFunctionArn = (LambdaDataSourceConfig -> Text)
-> (LambdaDataSourceConfig -> Text -> LambdaDataSourceConfig)
-> Lens LambdaDataSourceConfig LambdaDataSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaDataSourceConfig' {Text
lambdaFunctionArn :: Text
$sel:lambdaFunctionArn:LambdaDataSourceConfig' :: LambdaDataSourceConfig -> Text
lambdaFunctionArn} -> Text
lambdaFunctionArn) (\s :: LambdaDataSourceConfig
s@LambdaDataSourceConfig' {} Text
a -> LambdaDataSourceConfig
s {$sel:lambdaFunctionArn:LambdaDataSourceConfig' :: Text
lambdaFunctionArn = Text
a} :: LambdaDataSourceConfig)
instance Core.FromJSON LambdaDataSourceConfig where
parseJSON :: Value -> Parser LambdaDataSourceConfig
parseJSON =
String
-> (Object -> Parser LambdaDataSourceConfig)
-> Value
-> Parser LambdaDataSourceConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LambdaDataSourceConfig"
( \Object
x ->
Text -> LambdaDataSourceConfig
LambdaDataSourceConfig'
(Text -> LambdaDataSourceConfig)
-> Parser Text -> Parser LambdaDataSourceConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"lambdaFunctionArn")
)
instance Prelude.Hashable LambdaDataSourceConfig
instance Prelude.NFData LambdaDataSourceConfig
instance Core.ToJSON LambdaDataSourceConfig where
toJSON :: LambdaDataSourceConfig -> Value
toJSON LambdaDataSourceConfig' {Text
lambdaFunctionArn :: Text
$sel:lambdaFunctionArn:LambdaDataSourceConfig' :: LambdaDataSourceConfig -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"lambdaFunctionArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
lambdaFunctionArn)
]
)