{-# 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.ApiCache where
import Amazonka.AppSync.Types.ApiCacheStatus
import Amazonka.AppSync.Types.ApiCacheType
import Amazonka.AppSync.Types.ApiCachingBehavior
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ApiCache = ApiCache'
{
ApiCache -> Maybe Integer
ttl :: Prelude.Maybe Prelude.Integer,
ApiCache -> Maybe ApiCacheStatus
status :: Prelude.Maybe ApiCacheStatus,
ApiCache -> Maybe Bool
atRestEncryptionEnabled :: Prelude.Maybe Prelude.Bool,
ApiCache -> Maybe Bool
transitEncryptionEnabled :: Prelude.Maybe Prelude.Bool,
ApiCache -> Maybe ApiCachingBehavior
apiCachingBehavior :: Prelude.Maybe ApiCachingBehavior,
ApiCache -> Maybe ApiCacheType
type' :: Prelude.Maybe ApiCacheType
}
deriving (ApiCache -> ApiCache -> Bool
(ApiCache -> ApiCache -> Bool)
-> (ApiCache -> ApiCache -> Bool) -> Eq ApiCache
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApiCache -> ApiCache -> Bool
$c/= :: ApiCache -> ApiCache -> Bool
== :: ApiCache -> ApiCache -> Bool
$c== :: ApiCache -> ApiCache -> Bool
Prelude.Eq, ReadPrec [ApiCache]
ReadPrec ApiCache
Int -> ReadS ApiCache
ReadS [ApiCache]
(Int -> ReadS ApiCache)
-> ReadS [ApiCache]
-> ReadPrec ApiCache
-> ReadPrec [ApiCache]
-> Read ApiCache
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApiCache]
$creadListPrec :: ReadPrec [ApiCache]
readPrec :: ReadPrec ApiCache
$creadPrec :: ReadPrec ApiCache
readList :: ReadS [ApiCache]
$creadList :: ReadS [ApiCache]
readsPrec :: Int -> ReadS ApiCache
$creadsPrec :: Int -> ReadS ApiCache
Prelude.Read, Int -> ApiCache -> ShowS
[ApiCache] -> ShowS
ApiCache -> String
(Int -> ApiCache -> ShowS)
-> (ApiCache -> String) -> ([ApiCache] -> ShowS) -> Show ApiCache
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApiCache] -> ShowS
$cshowList :: [ApiCache] -> ShowS
show :: ApiCache -> String
$cshow :: ApiCache -> String
showsPrec :: Int -> ApiCache -> ShowS
$cshowsPrec :: Int -> ApiCache -> ShowS
Prelude.Show, (forall x. ApiCache -> Rep ApiCache x)
-> (forall x. Rep ApiCache x -> ApiCache) -> Generic ApiCache
forall x. Rep ApiCache x -> ApiCache
forall x. ApiCache -> Rep ApiCache x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApiCache x -> ApiCache
$cfrom :: forall x. ApiCache -> Rep ApiCache x
Prelude.Generic)
newApiCache ::
ApiCache
newApiCache :: ApiCache
newApiCache =
ApiCache' :: Maybe Integer
-> Maybe ApiCacheStatus
-> Maybe Bool
-> Maybe Bool
-> Maybe ApiCachingBehavior
-> Maybe ApiCacheType
-> ApiCache
ApiCache'
{ $sel:ttl:ApiCache' :: Maybe Integer
ttl = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:status:ApiCache' :: Maybe ApiCacheStatus
status = Maybe ApiCacheStatus
forall a. Maybe a
Prelude.Nothing,
$sel:atRestEncryptionEnabled:ApiCache' :: Maybe Bool
atRestEncryptionEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:transitEncryptionEnabled:ApiCache' :: Maybe Bool
transitEncryptionEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:apiCachingBehavior:ApiCache' :: Maybe ApiCachingBehavior
apiCachingBehavior = Maybe ApiCachingBehavior
forall a. Maybe a
Prelude.Nothing,
$sel:type':ApiCache' :: Maybe ApiCacheType
type' = Maybe ApiCacheType
forall a. Maybe a
Prelude.Nothing
}
apiCache_ttl :: Lens.Lens' ApiCache (Prelude.Maybe Prelude.Integer)
apiCache_ttl :: (Maybe Integer -> f (Maybe Integer)) -> ApiCache -> f ApiCache
apiCache_ttl = (ApiCache -> Maybe Integer)
-> (ApiCache -> Maybe Integer -> ApiCache)
-> Lens ApiCache ApiCache (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiCache' {Maybe Integer
ttl :: Maybe Integer
$sel:ttl:ApiCache' :: ApiCache -> Maybe Integer
ttl} -> Maybe Integer
ttl) (\s :: ApiCache
s@ApiCache' {} Maybe Integer
a -> ApiCache
s {$sel:ttl:ApiCache' :: Maybe Integer
ttl = Maybe Integer
a} :: ApiCache)
apiCache_status :: Lens.Lens' ApiCache (Prelude.Maybe ApiCacheStatus)
apiCache_status :: (Maybe ApiCacheStatus -> f (Maybe ApiCacheStatus))
-> ApiCache -> f ApiCache
apiCache_status = (ApiCache -> Maybe ApiCacheStatus)
-> (ApiCache -> Maybe ApiCacheStatus -> ApiCache)
-> Lens
ApiCache ApiCache (Maybe ApiCacheStatus) (Maybe ApiCacheStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiCache' {Maybe ApiCacheStatus
status :: Maybe ApiCacheStatus
$sel:status:ApiCache' :: ApiCache -> Maybe ApiCacheStatus
status} -> Maybe ApiCacheStatus
status) (\s :: ApiCache
s@ApiCache' {} Maybe ApiCacheStatus
a -> ApiCache
s {$sel:status:ApiCache' :: Maybe ApiCacheStatus
status = Maybe ApiCacheStatus
a} :: ApiCache)
apiCache_atRestEncryptionEnabled :: Lens.Lens' ApiCache (Prelude.Maybe Prelude.Bool)
apiCache_atRestEncryptionEnabled :: (Maybe Bool -> f (Maybe Bool)) -> ApiCache -> f ApiCache
apiCache_atRestEncryptionEnabled = (ApiCache -> Maybe Bool)
-> (ApiCache -> Maybe Bool -> ApiCache)
-> Lens ApiCache ApiCache (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiCache' {Maybe Bool
atRestEncryptionEnabled :: Maybe Bool
$sel:atRestEncryptionEnabled:ApiCache' :: ApiCache -> Maybe Bool
atRestEncryptionEnabled} -> Maybe Bool
atRestEncryptionEnabled) (\s :: ApiCache
s@ApiCache' {} Maybe Bool
a -> ApiCache
s {$sel:atRestEncryptionEnabled:ApiCache' :: Maybe Bool
atRestEncryptionEnabled = Maybe Bool
a} :: ApiCache)
apiCache_transitEncryptionEnabled :: Lens.Lens' ApiCache (Prelude.Maybe Prelude.Bool)
apiCache_transitEncryptionEnabled :: (Maybe Bool -> f (Maybe Bool)) -> ApiCache -> f ApiCache
apiCache_transitEncryptionEnabled = (ApiCache -> Maybe Bool)
-> (ApiCache -> Maybe Bool -> ApiCache)
-> Lens ApiCache ApiCache (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiCache' {Maybe Bool
transitEncryptionEnabled :: Maybe Bool
$sel:transitEncryptionEnabled:ApiCache' :: ApiCache -> Maybe Bool
transitEncryptionEnabled} -> Maybe Bool
transitEncryptionEnabled) (\s :: ApiCache
s@ApiCache' {} Maybe Bool
a -> ApiCache
s {$sel:transitEncryptionEnabled:ApiCache' :: Maybe Bool
transitEncryptionEnabled = Maybe Bool
a} :: ApiCache)
apiCache_apiCachingBehavior :: Lens.Lens' ApiCache (Prelude.Maybe ApiCachingBehavior)
apiCache_apiCachingBehavior :: (Maybe ApiCachingBehavior -> f (Maybe ApiCachingBehavior))
-> ApiCache -> f ApiCache
apiCache_apiCachingBehavior = (ApiCache -> Maybe ApiCachingBehavior)
-> (ApiCache -> Maybe ApiCachingBehavior -> ApiCache)
-> Lens
ApiCache
ApiCache
(Maybe ApiCachingBehavior)
(Maybe ApiCachingBehavior)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiCache' {Maybe ApiCachingBehavior
apiCachingBehavior :: Maybe ApiCachingBehavior
$sel:apiCachingBehavior:ApiCache' :: ApiCache -> Maybe ApiCachingBehavior
apiCachingBehavior} -> Maybe ApiCachingBehavior
apiCachingBehavior) (\s :: ApiCache
s@ApiCache' {} Maybe ApiCachingBehavior
a -> ApiCache
s {$sel:apiCachingBehavior:ApiCache' :: Maybe ApiCachingBehavior
apiCachingBehavior = Maybe ApiCachingBehavior
a} :: ApiCache)
apiCache_type :: Lens.Lens' ApiCache (Prelude.Maybe ApiCacheType)
apiCache_type :: (Maybe ApiCacheType -> f (Maybe ApiCacheType))
-> ApiCache -> f ApiCache
apiCache_type = (ApiCache -> Maybe ApiCacheType)
-> (ApiCache -> Maybe ApiCacheType -> ApiCache)
-> Lens ApiCache ApiCache (Maybe ApiCacheType) (Maybe ApiCacheType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiCache' {Maybe ApiCacheType
type' :: Maybe ApiCacheType
$sel:type':ApiCache' :: ApiCache -> Maybe ApiCacheType
type'} -> Maybe ApiCacheType
type') (\s :: ApiCache
s@ApiCache' {} Maybe ApiCacheType
a -> ApiCache
s {$sel:type':ApiCache' :: Maybe ApiCacheType
type' = Maybe ApiCacheType
a} :: ApiCache)
instance Core.FromJSON ApiCache where
parseJSON :: Value -> Parser ApiCache
parseJSON =
String -> (Object -> Parser ApiCache) -> Value -> Parser ApiCache
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ApiCache"
( \Object
x ->
Maybe Integer
-> Maybe ApiCacheStatus
-> Maybe Bool
-> Maybe Bool
-> Maybe ApiCachingBehavior
-> Maybe ApiCacheType
-> ApiCache
ApiCache'
(Maybe Integer
-> Maybe ApiCacheStatus
-> Maybe Bool
-> Maybe Bool
-> Maybe ApiCachingBehavior
-> Maybe ApiCacheType
-> ApiCache)
-> Parser (Maybe Integer)
-> Parser
(Maybe ApiCacheStatus
-> Maybe Bool
-> Maybe Bool
-> Maybe ApiCachingBehavior
-> Maybe ApiCacheType
-> ApiCache)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ttl")
Parser
(Maybe ApiCacheStatus
-> Maybe Bool
-> Maybe Bool
-> Maybe ApiCachingBehavior
-> Maybe ApiCacheType
-> ApiCache)
-> Parser (Maybe ApiCacheStatus)
-> Parser
(Maybe Bool
-> Maybe Bool
-> Maybe ApiCachingBehavior
-> Maybe ApiCacheType
-> ApiCache)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ApiCacheStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe Bool
-> Maybe Bool
-> Maybe ApiCachingBehavior
-> Maybe ApiCacheType
-> ApiCache)
-> Parser (Maybe Bool)
-> Parser
(Maybe Bool
-> Maybe ApiCachingBehavior -> Maybe ApiCacheType -> ApiCache)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"atRestEncryptionEnabled")
Parser
(Maybe Bool
-> Maybe ApiCachingBehavior -> Maybe ApiCacheType -> ApiCache)
-> Parser (Maybe Bool)
-> Parser
(Maybe ApiCachingBehavior -> Maybe ApiCacheType -> ApiCache)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"transitEncryptionEnabled")
Parser (Maybe ApiCachingBehavior -> Maybe ApiCacheType -> ApiCache)
-> Parser (Maybe ApiCachingBehavior)
-> Parser (Maybe ApiCacheType -> ApiCache)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ApiCachingBehavior)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"apiCachingBehavior")
Parser (Maybe ApiCacheType -> ApiCache)
-> Parser (Maybe ApiCacheType) -> Parser ApiCache
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ApiCacheType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
)
instance Prelude.Hashable ApiCache
instance Prelude.NFData ApiCache