{-# 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.Resolver where
import Amazonka.AppSync.Types.CachingConfig
import Amazonka.AppSync.Types.PipelineConfig
import Amazonka.AppSync.Types.ResolverKind
import Amazonka.AppSync.Types.SyncConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Resolver = Resolver'
{
Resolver -> Maybe Text
typeName :: Prelude.Maybe Prelude.Text,
Resolver -> Maybe Text
dataSourceName :: Prelude.Maybe Prelude.Text,
Resolver -> Maybe Text
requestMappingTemplate :: Prelude.Maybe Prelude.Text,
Resolver -> Maybe ResolverKind
kind :: Prelude.Maybe ResolverKind,
Resolver -> Maybe Text
resolverArn :: Prelude.Maybe Prelude.Text,
Resolver -> Maybe CachingConfig
cachingConfig :: Prelude.Maybe CachingConfig,
Resolver -> Maybe Text
responseMappingTemplate :: Prelude.Maybe Prelude.Text,
Resolver -> Maybe Text
fieldName :: Prelude.Maybe Prelude.Text,
Resolver -> Maybe SyncConfig
syncConfig :: Prelude.Maybe SyncConfig,
Resolver -> Maybe PipelineConfig
pipelineConfig :: Prelude.Maybe PipelineConfig
}
deriving (Resolver -> Resolver -> Bool
(Resolver -> Resolver -> Bool)
-> (Resolver -> Resolver -> Bool) -> Eq Resolver
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Resolver -> Resolver -> Bool
$c/= :: Resolver -> Resolver -> Bool
== :: Resolver -> Resolver -> Bool
$c== :: Resolver -> Resolver -> Bool
Prelude.Eq, ReadPrec [Resolver]
ReadPrec Resolver
Int -> ReadS Resolver
ReadS [Resolver]
(Int -> ReadS Resolver)
-> ReadS [Resolver]
-> ReadPrec Resolver
-> ReadPrec [Resolver]
-> Read Resolver
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Resolver]
$creadListPrec :: ReadPrec [Resolver]
readPrec :: ReadPrec Resolver
$creadPrec :: ReadPrec Resolver
readList :: ReadS [Resolver]
$creadList :: ReadS [Resolver]
readsPrec :: Int -> ReadS Resolver
$creadsPrec :: Int -> ReadS Resolver
Prelude.Read, Int -> Resolver -> ShowS
[Resolver] -> ShowS
Resolver -> String
(Int -> Resolver -> ShowS)
-> (Resolver -> String) -> ([Resolver] -> ShowS) -> Show Resolver
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Resolver] -> ShowS
$cshowList :: [Resolver] -> ShowS
show :: Resolver -> String
$cshow :: Resolver -> String
showsPrec :: Int -> Resolver -> ShowS
$cshowsPrec :: Int -> Resolver -> ShowS
Prelude.Show, (forall x. Resolver -> Rep Resolver x)
-> (forall x. Rep Resolver x -> Resolver) -> Generic Resolver
forall x. Rep Resolver x -> Resolver
forall x. Resolver -> Rep Resolver x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Resolver x -> Resolver
$cfrom :: forall x. Resolver -> Rep Resolver x
Prelude.Generic)
newResolver ::
Resolver
newResolver :: Resolver
newResolver =
Resolver' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ResolverKind
-> Maybe Text
-> Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver
Resolver'
{ $sel:typeName:Resolver' :: Maybe Text
typeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataSourceName:Resolver' :: Maybe Text
dataSourceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:requestMappingTemplate:Resolver' :: Maybe Text
requestMappingTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:kind:Resolver' :: Maybe ResolverKind
kind = Maybe ResolverKind
forall a. Maybe a
Prelude.Nothing,
$sel:resolverArn:Resolver' :: Maybe Text
resolverArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cachingConfig:Resolver' :: Maybe CachingConfig
cachingConfig = Maybe CachingConfig
forall a. Maybe a
Prelude.Nothing,
$sel:responseMappingTemplate:Resolver' :: Maybe Text
responseMappingTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fieldName:Resolver' :: Maybe Text
fieldName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:syncConfig:Resolver' :: Maybe SyncConfig
syncConfig = Maybe SyncConfig
forall a. Maybe a
Prelude.Nothing,
$sel:pipelineConfig:Resolver' :: Maybe PipelineConfig
pipelineConfig = Maybe PipelineConfig
forall a. Maybe a
Prelude.Nothing
}
resolver_typeName :: Lens.Lens' Resolver (Prelude.Maybe Prelude.Text)
resolver_typeName :: (Maybe Text -> f (Maybe Text)) -> Resolver -> f Resolver
resolver_typeName = (Resolver -> Maybe Text)
-> (Resolver -> Maybe Text -> Resolver)
-> Lens Resolver Resolver (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resolver' {Maybe Text
typeName :: Maybe Text
$sel:typeName:Resolver' :: Resolver -> Maybe Text
typeName} -> Maybe Text
typeName) (\s :: Resolver
s@Resolver' {} Maybe Text
a -> Resolver
s {$sel:typeName:Resolver' :: Maybe Text
typeName = Maybe Text
a} :: Resolver)
resolver_dataSourceName :: Lens.Lens' Resolver (Prelude.Maybe Prelude.Text)
resolver_dataSourceName :: (Maybe Text -> f (Maybe Text)) -> Resolver -> f Resolver
resolver_dataSourceName = (Resolver -> Maybe Text)
-> (Resolver -> Maybe Text -> Resolver)
-> Lens Resolver Resolver (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resolver' {Maybe Text
dataSourceName :: Maybe Text
$sel:dataSourceName:Resolver' :: Resolver -> Maybe Text
dataSourceName} -> Maybe Text
dataSourceName) (\s :: Resolver
s@Resolver' {} Maybe Text
a -> Resolver
s {$sel:dataSourceName:Resolver' :: Maybe Text
dataSourceName = Maybe Text
a} :: Resolver)
resolver_requestMappingTemplate :: Lens.Lens' Resolver (Prelude.Maybe Prelude.Text)
resolver_requestMappingTemplate :: (Maybe Text -> f (Maybe Text)) -> Resolver -> f Resolver
resolver_requestMappingTemplate = (Resolver -> Maybe Text)
-> (Resolver -> Maybe Text -> Resolver)
-> Lens Resolver Resolver (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resolver' {Maybe Text
requestMappingTemplate :: Maybe Text
$sel:requestMappingTemplate:Resolver' :: Resolver -> Maybe Text
requestMappingTemplate} -> Maybe Text
requestMappingTemplate) (\s :: Resolver
s@Resolver' {} Maybe Text
a -> Resolver
s {$sel:requestMappingTemplate:Resolver' :: Maybe Text
requestMappingTemplate = Maybe Text
a} :: Resolver)
resolver_kind :: Lens.Lens' Resolver (Prelude.Maybe ResolverKind)
resolver_kind :: (Maybe ResolverKind -> f (Maybe ResolverKind))
-> Resolver -> f Resolver
resolver_kind = (Resolver -> Maybe ResolverKind)
-> (Resolver -> Maybe ResolverKind -> Resolver)
-> Lens Resolver Resolver (Maybe ResolverKind) (Maybe ResolverKind)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resolver' {Maybe ResolverKind
kind :: Maybe ResolverKind
$sel:kind:Resolver' :: Resolver -> Maybe ResolverKind
kind} -> Maybe ResolverKind
kind) (\s :: Resolver
s@Resolver' {} Maybe ResolverKind
a -> Resolver
s {$sel:kind:Resolver' :: Maybe ResolverKind
kind = Maybe ResolverKind
a} :: Resolver)
resolver_resolverArn :: Lens.Lens' Resolver (Prelude.Maybe Prelude.Text)
resolver_resolverArn :: (Maybe Text -> f (Maybe Text)) -> Resolver -> f Resolver
resolver_resolverArn = (Resolver -> Maybe Text)
-> (Resolver -> Maybe Text -> Resolver)
-> Lens Resolver Resolver (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resolver' {Maybe Text
resolverArn :: Maybe Text
$sel:resolverArn:Resolver' :: Resolver -> Maybe Text
resolverArn} -> Maybe Text
resolverArn) (\s :: Resolver
s@Resolver' {} Maybe Text
a -> Resolver
s {$sel:resolverArn:Resolver' :: Maybe Text
resolverArn = Maybe Text
a} :: Resolver)
resolver_cachingConfig :: Lens.Lens' Resolver (Prelude.Maybe CachingConfig)
resolver_cachingConfig :: (Maybe CachingConfig -> f (Maybe CachingConfig))
-> Resolver -> f Resolver
resolver_cachingConfig = (Resolver -> Maybe CachingConfig)
-> (Resolver -> Maybe CachingConfig -> Resolver)
-> Lens
Resolver Resolver (Maybe CachingConfig) (Maybe CachingConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resolver' {Maybe CachingConfig
cachingConfig :: Maybe CachingConfig
$sel:cachingConfig:Resolver' :: Resolver -> Maybe CachingConfig
cachingConfig} -> Maybe CachingConfig
cachingConfig) (\s :: Resolver
s@Resolver' {} Maybe CachingConfig
a -> Resolver
s {$sel:cachingConfig:Resolver' :: Maybe CachingConfig
cachingConfig = Maybe CachingConfig
a} :: Resolver)
resolver_responseMappingTemplate :: Lens.Lens' Resolver (Prelude.Maybe Prelude.Text)
resolver_responseMappingTemplate :: (Maybe Text -> f (Maybe Text)) -> Resolver -> f Resolver
resolver_responseMappingTemplate = (Resolver -> Maybe Text)
-> (Resolver -> Maybe Text -> Resolver)
-> Lens Resolver Resolver (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resolver' {Maybe Text
responseMappingTemplate :: Maybe Text
$sel:responseMappingTemplate:Resolver' :: Resolver -> Maybe Text
responseMappingTemplate} -> Maybe Text
responseMappingTemplate) (\s :: Resolver
s@Resolver' {} Maybe Text
a -> Resolver
s {$sel:responseMappingTemplate:Resolver' :: Maybe Text
responseMappingTemplate = Maybe Text
a} :: Resolver)
resolver_fieldName :: Lens.Lens' Resolver (Prelude.Maybe Prelude.Text)
resolver_fieldName :: (Maybe Text -> f (Maybe Text)) -> Resolver -> f Resolver
resolver_fieldName = (Resolver -> Maybe Text)
-> (Resolver -> Maybe Text -> Resolver)
-> Lens Resolver Resolver (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resolver' {Maybe Text
fieldName :: Maybe Text
$sel:fieldName:Resolver' :: Resolver -> Maybe Text
fieldName} -> Maybe Text
fieldName) (\s :: Resolver
s@Resolver' {} Maybe Text
a -> Resolver
s {$sel:fieldName:Resolver' :: Maybe Text
fieldName = Maybe Text
a} :: Resolver)
resolver_syncConfig :: Lens.Lens' Resolver (Prelude.Maybe SyncConfig)
resolver_syncConfig :: (Maybe SyncConfig -> f (Maybe SyncConfig))
-> Resolver -> f Resolver
resolver_syncConfig = (Resolver -> Maybe SyncConfig)
-> (Resolver -> Maybe SyncConfig -> Resolver)
-> Lens Resolver Resolver (Maybe SyncConfig) (Maybe SyncConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resolver' {Maybe SyncConfig
syncConfig :: Maybe SyncConfig
$sel:syncConfig:Resolver' :: Resolver -> Maybe SyncConfig
syncConfig} -> Maybe SyncConfig
syncConfig) (\s :: Resolver
s@Resolver' {} Maybe SyncConfig
a -> Resolver
s {$sel:syncConfig:Resolver' :: Maybe SyncConfig
syncConfig = Maybe SyncConfig
a} :: Resolver)
resolver_pipelineConfig :: Lens.Lens' Resolver (Prelude.Maybe PipelineConfig)
resolver_pipelineConfig :: (Maybe PipelineConfig -> f (Maybe PipelineConfig))
-> Resolver -> f Resolver
resolver_pipelineConfig = (Resolver -> Maybe PipelineConfig)
-> (Resolver -> Maybe PipelineConfig -> Resolver)
-> Lens
Resolver Resolver (Maybe PipelineConfig) (Maybe PipelineConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resolver' {Maybe PipelineConfig
pipelineConfig :: Maybe PipelineConfig
$sel:pipelineConfig:Resolver' :: Resolver -> Maybe PipelineConfig
pipelineConfig} -> Maybe PipelineConfig
pipelineConfig) (\s :: Resolver
s@Resolver' {} Maybe PipelineConfig
a -> Resolver
s {$sel:pipelineConfig:Resolver' :: Maybe PipelineConfig
pipelineConfig = Maybe PipelineConfig
a} :: Resolver)
instance Core.FromJSON Resolver where
parseJSON :: Value -> Parser Resolver
parseJSON =
String -> (Object -> Parser Resolver) -> Value -> Parser Resolver
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Resolver"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ResolverKind
-> Maybe Text
-> Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver
Resolver'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ResolverKind
-> Maybe Text
-> Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe ResolverKind
-> Maybe Text
-> Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
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
"typeName")
Parser
(Maybe Text
-> Maybe Text
-> Maybe ResolverKind
-> Maybe Text
-> Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe ResolverKind
-> Maybe Text
-> Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
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 ResolverKind
-> Maybe Text
-> Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
-> Parser (Maybe Text)
-> Parser
(Maybe ResolverKind
-> Maybe Text
-> Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
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 ResolverKind
-> Maybe Text
-> Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
-> Parser (Maybe ResolverKind)
-> Parser
(Maybe Text
-> Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResolverKind)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"kind")
Parser
(Maybe Text
-> Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
-> Parser (Maybe Text)
-> Parser
(Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
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
"resolverArn")
Parser
(Maybe CachingConfig
-> Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
-> Parser (Maybe CachingConfig)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CachingConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cachingConfig")
Parser
(Maybe Text
-> Maybe Text
-> Maybe SyncConfig
-> Maybe PipelineConfig
-> Resolver)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe SyncConfig -> Maybe PipelineConfig -> Resolver)
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 Text
-> Maybe SyncConfig -> Maybe PipelineConfig -> Resolver)
-> Parser (Maybe Text)
-> Parser (Maybe SyncConfig -> Maybe PipelineConfig -> Resolver)
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
"fieldName")
Parser (Maybe SyncConfig -> Maybe PipelineConfig -> Resolver)
-> Parser (Maybe SyncConfig)
-> Parser (Maybe PipelineConfig -> Resolver)
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 PipelineConfig -> Resolver)
-> Parser (Maybe PipelineConfig) -> Parser Resolver
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PipelineConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pipelineConfig")
)
instance Prelude.Hashable Resolver
instance Prelude.NFData Resolver