{-# 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.FunctionConfiguration where
import Amazonka.AppSync.Types.SyncConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FunctionConfiguration = FunctionConfiguration'
{
FunctionConfiguration -> Maybe Text
functionArn :: Prelude.Maybe Prelude.Text,
FunctionConfiguration -> Maybe Text
dataSourceName :: Prelude.Maybe Prelude.Text,
FunctionConfiguration -> Maybe Text
requestMappingTemplate :: Prelude.Maybe Prelude.Text,
FunctionConfiguration -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
FunctionConfiguration -> Maybe Text
functionId :: Prelude.Maybe Prelude.Text,
FunctionConfiguration -> Maybe Text
responseMappingTemplate :: Prelude.Maybe Prelude.Text,
FunctionConfiguration -> Maybe SyncConfig
syncConfig :: Prelude.Maybe SyncConfig,
FunctionConfiguration -> Maybe Text
functionVersion :: Prelude.Maybe Prelude.Text,
FunctionConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (FunctionConfiguration -> FunctionConfiguration -> Bool
(FunctionConfiguration -> FunctionConfiguration -> Bool)
-> (FunctionConfiguration -> FunctionConfiguration -> Bool)
-> Eq FunctionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FunctionConfiguration -> FunctionConfiguration -> Bool
$c/= :: FunctionConfiguration -> FunctionConfiguration -> Bool
== :: FunctionConfiguration -> FunctionConfiguration -> Bool
$c== :: FunctionConfiguration -> FunctionConfiguration -> Bool
Prelude.Eq, ReadPrec [FunctionConfiguration]
ReadPrec FunctionConfiguration
Int -> ReadS FunctionConfiguration
ReadS [FunctionConfiguration]
(Int -> ReadS FunctionConfiguration)
-> ReadS [FunctionConfiguration]
-> ReadPrec FunctionConfiguration
-> ReadPrec [FunctionConfiguration]
-> Read FunctionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FunctionConfiguration]
$creadListPrec :: ReadPrec [FunctionConfiguration]
readPrec :: ReadPrec FunctionConfiguration
$creadPrec :: ReadPrec FunctionConfiguration
readList :: ReadS [FunctionConfiguration]
$creadList :: ReadS [FunctionConfiguration]
readsPrec :: Int -> ReadS FunctionConfiguration
$creadsPrec :: Int -> ReadS FunctionConfiguration
Prelude.Read, Int -> FunctionConfiguration -> ShowS
[FunctionConfiguration] -> ShowS
FunctionConfiguration -> String
(Int -> FunctionConfiguration -> ShowS)
-> (FunctionConfiguration -> String)
-> ([FunctionConfiguration] -> ShowS)
-> Show FunctionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FunctionConfiguration] -> ShowS
$cshowList :: [FunctionConfiguration] -> ShowS
show :: FunctionConfiguration -> String
$cshow :: FunctionConfiguration -> String
showsPrec :: Int -> FunctionConfiguration -> ShowS
$cshowsPrec :: Int -> FunctionConfiguration -> ShowS
Prelude.Show, (forall x. FunctionConfiguration -> Rep FunctionConfiguration x)
-> (forall x. Rep FunctionConfiguration x -> FunctionConfiguration)
-> Generic FunctionConfiguration
forall x. Rep FunctionConfiguration x -> FunctionConfiguration
forall x. FunctionConfiguration -> Rep FunctionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FunctionConfiguration x -> FunctionConfiguration
$cfrom :: forall x. FunctionConfiguration -> Rep FunctionConfiguration x
Prelude.Generic)
newFunctionConfiguration ::
FunctionConfiguration
newFunctionConfiguration :: FunctionConfiguration
newFunctionConfiguration =
FunctionConfiguration' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration
FunctionConfiguration'
{ $sel:functionArn:FunctionConfiguration' :: Maybe Text
functionArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataSourceName:FunctionConfiguration' :: Maybe Text
dataSourceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:requestMappingTemplate:FunctionConfiguration' :: Maybe Text
requestMappingTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:FunctionConfiguration' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:functionId:FunctionConfiguration' :: Maybe Text
functionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:responseMappingTemplate:FunctionConfiguration' :: Maybe Text
responseMappingTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:syncConfig:FunctionConfiguration' :: Maybe SyncConfig
syncConfig = Maybe SyncConfig
forall a. Maybe a
Prelude.Nothing,
$sel:functionVersion:FunctionConfiguration' :: Maybe Text
functionVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:FunctionConfiguration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
functionConfiguration_functionArn :: Lens.Lens' FunctionConfiguration (Prelude.Maybe Prelude.Text)
functionConfiguration_functionArn :: (Maybe Text -> f (Maybe Text))
-> FunctionConfiguration -> f FunctionConfiguration
functionConfiguration_functionArn = (FunctionConfiguration -> Maybe Text)
-> (FunctionConfiguration -> Maybe Text -> FunctionConfiguration)
-> Lens
FunctionConfiguration
FunctionConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionConfiguration' {Maybe Text
functionArn :: Maybe Text
$sel:functionArn:FunctionConfiguration' :: FunctionConfiguration -> Maybe Text
functionArn} -> Maybe Text
functionArn) (\s :: FunctionConfiguration
s@FunctionConfiguration' {} Maybe Text
a -> FunctionConfiguration
s {$sel:functionArn:FunctionConfiguration' :: Maybe Text
functionArn = Maybe Text
a} :: FunctionConfiguration)
functionConfiguration_dataSourceName :: Lens.Lens' FunctionConfiguration (Prelude.Maybe Prelude.Text)
functionConfiguration_dataSourceName :: (Maybe Text -> f (Maybe Text))
-> FunctionConfiguration -> f FunctionConfiguration
functionConfiguration_dataSourceName = (FunctionConfiguration -> Maybe Text)
-> (FunctionConfiguration -> Maybe Text -> FunctionConfiguration)
-> Lens
FunctionConfiguration
FunctionConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionConfiguration' {Maybe Text
dataSourceName :: Maybe Text
$sel:dataSourceName:FunctionConfiguration' :: FunctionConfiguration -> Maybe Text
dataSourceName} -> Maybe Text
dataSourceName) (\s :: FunctionConfiguration
s@FunctionConfiguration' {} Maybe Text
a -> FunctionConfiguration
s {$sel:dataSourceName:FunctionConfiguration' :: Maybe Text
dataSourceName = Maybe Text
a} :: FunctionConfiguration)
functionConfiguration_requestMappingTemplate :: Lens.Lens' FunctionConfiguration (Prelude.Maybe Prelude.Text)
functionConfiguration_requestMappingTemplate :: (Maybe Text -> f (Maybe Text))
-> FunctionConfiguration -> f FunctionConfiguration
functionConfiguration_requestMappingTemplate = (FunctionConfiguration -> Maybe Text)
-> (FunctionConfiguration -> Maybe Text -> FunctionConfiguration)
-> Lens
FunctionConfiguration
FunctionConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionConfiguration' {Maybe Text
requestMappingTemplate :: Maybe Text
$sel:requestMappingTemplate:FunctionConfiguration' :: FunctionConfiguration -> Maybe Text
requestMappingTemplate} -> Maybe Text
requestMappingTemplate) (\s :: FunctionConfiguration
s@FunctionConfiguration' {} Maybe Text
a -> FunctionConfiguration
s {$sel:requestMappingTemplate:FunctionConfiguration' :: Maybe Text
requestMappingTemplate = Maybe Text
a} :: FunctionConfiguration)
functionConfiguration_name :: Lens.Lens' FunctionConfiguration (Prelude.Maybe Prelude.Text)
functionConfiguration_name :: (Maybe Text -> f (Maybe Text))
-> FunctionConfiguration -> f FunctionConfiguration
functionConfiguration_name = (FunctionConfiguration -> Maybe Text)
-> (FunctionConfiguration -> Maybe Text -> FunctionConfiguration)
-> Lens
FunctionConfiguration
FunctionConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionConfiguration' {Maybe Text
name :: Maybe Text
$sel:name:FunctionConfiguration' :: FunctionConfiguration -> Maybe Text
name} -> Maybe Text
name) (\s :: FunctionConfiguration
s@FunctionConfiguration' {} Maybe Text
a -> FunctionConfiguration
s {$sel:name:FunctionConfiguration' :: Maybe Text
name = Maybe Text
a} :: FunctionConfiguration)
functionConfiguration_functionId :: Lens.Lens' FunctionConfiguration (Prelude.Maybe Prelude.Text)
functionConfiguration_functionId :: (Maybe Text -> f (Maybe Text))
-> FunctionConfiguration -> f FunctionConfiguration
functionConfiguration_functionId = (FunctionConfiguration -> Maybe Text)
-> (FunctionConfiguration -> Maybe Text -> FunctionConfiguration)
-> Lens
FunctionConfiguration
FunctionConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionConfiguration' {Maybe Text
functionId :: Maybe Text
$sel:functionId:FunctionConfiguration' :: FunctionConfiguration -> Maybe Text
functionId} -> Maybe Text
functionId) (\s :: FunctionConfiguration
s@FunctionConfiguration' {} Maybe Text
a -> FunctionConfiguration
s {$sel:functionId:FunctionConfiguration' :: Maybe Text
functionId = Maybe Text
a} :: FunctionConfiguration)
functionConfiguration_responseMappingTemplate :: Lens.Lens' FunctionConfiguration (Prelude.Maybe Prelude.Text)
functionConfiguration_responseMappingTemplate :: (Maybe Text -> f (Maybe Text))
-> FunctionConfiguration -> f FunctionConfiguration
functionConfiguration_responseMappingTemplate = (FunctionConfiguration -> Maybe Text)
-> (FunctionConfiguration -> Maybe Text -> FunctionConfiguration)
-> Lens
FunctionConfiguration
FunctionConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionConfiguration' {Maybe Text
responseMappingTemplate :: Maybe Text
$sel:responseMappingTemplate:FunctionConfiguration' :: FunctionConfiguration -> Maybe Text
responseMappingTemplate} -> Maybe Text
responseMappingTemplate) (\s :: FunctionConfiguration
s@FunctionConfiguration' {} Maybe Text
a -> FunctionConfiguration
s {$sel:responseMappingTemplate:FunctionConfiguration' :: Maybe Text
responseMappingTemplate = Maybe Text
a} :: FunctionConfiguration)
functionConfiguration_syncConfig :: Lens.Lens' FunctionConfiguration (Prelude.Maybe SyncConfig)
functionConfiguration_syncConfig :: (Maybe SyncConfig -> f (Maybe SyncConfig))
-> FunctionConfiguration -> f FunctionConfiguration
functionConfiguration_syncConfig = (FunctionConfiguration -> Maybe SyncConfig)
-> (FunctionConfiguration
-> Maybe SyncConfig -> FunctionConfiguration)
-> Lens
FunctionConfiguration
FunctionConfiguration
(Maybe SyncConfig)
(Maybe SyncConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionConfiguration' {Maybe SyncConfig
syncConfig :: Maybe SyncConfig
$sel:syncConfig:FunctionConfiguration' :: FunctionConfiguration -> Maybe SyncConfig
syncConfig} -> Maybe SyncConfig
syncConfig) (\s :: FunctionConfiguration
s@FunctionConfiguration' {} Maybe SyncConfig
a -> FunctionConfiguration
s {$sel:syncConfig:FunctionConfiguration' :: Maybe SyncConfig
syncConfig = Maybe SyncConfig
a} :: FunctionConfiguration)
functionConfiguration_functionVersion :: Lens.Lens' FunctionConfiguration (Prelude.Maybe Prelude.Text)
functionConfiguration_functionVersion :: (Maybe Text -> f (Maybe Text))
-> FunctionConfiguration -> f FunctionConfiguration
functionConfiguration_functionVersion = (FunctionConfiguration -> Maybe Text)
-> (FunctionConfiguration -> Maybe Text -> FunctionConfiguration)
-> Lens
FunctionConfiguration
FunctionConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionConfiguration' {Maybe Text
functionVersion :: Maybe Text
$sel:functionVersion:FunctionConfiguration' :: FunctionConfiguration -> Maybe Text
functionVersion} -> Maybe Text
functionVersion) (\s :: FunctionConfiguration
s@FunctionConfiguration' {} Maybe Text
a -> FunctionConfiguration
s {$sel:functionVersion:FunctionConfiguration' :: Maybe Text
functionVersion = Maybe Text
a} :: FunctionConfiguration)
functionConfiguration_description :: Lens.Lens' FunctionConfiguration (Prelude.Maybe Prelude.Text)
functionConfiguration_description :: (Maybe Text -> f (Maybe Text))
-> FunctionConfiguration -> f FunctionConfiguration
functionConfiguration_description = (FunctionConfiguration -> Maybe Text)
-> (FunctionConfiguration -> Maybe Text -> FunctionConfiguration)
-> Lens
FunctionConfiguration
FunctionConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:FunctionConfiguration' :: FunctionConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: FunctionConfiguration
s@FunctionConfiguration' {} Maybe Text
a -> FunctionConfiguration
s {$sel:description:FunctionConfiguration' :: Maybe Text
description = Maybe Text
a} :: FunctionConfiguration)
instance Core.FromJSON FunctionConfiguration where
parseJSON :: Value -> Parser FunctionConfiguration
parseJSON =
String
-> (Object -> Parser FunctionConfiguration)
-> Value
-> Parser FunctionConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FunctionConfiguration"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration
FunctionConfiguration'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"functionArn")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dataSourceName")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"requestMappingTemplate")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
Parser
(Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"functionId")
Parser
(Maybe Text
-> Maybe SyncConfig
-> Maybe Text
-> Maybe Text
-> FunctionConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe SyncConfig
-> Maybe Text -> Maybe Text -> FunctionConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"responseMappingTemplate")
Parser
(Maybe SyncConfig
-> Maybe Text -> Maybe Text -> FunctionConfiguration)
-> Parser (Maybe SyncConfig)
-> Parser (Maybe Text -> Maybe Text -> FunctionConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SyncConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"syncConfig")
Parser (Maybe Text -> Maybe Text -> FunctionConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> FunctionConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"functionVersion")
Parser (Maybe Text -> FunctionConfiguration)
-> Parser (Maybe Text) -> Parser FunctionConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
)
instance Prelude.Hashable FunctionConfiguration
instance Prelude.NFData FunctionConfiguration