{-# 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.Athena.Types.ResultReuseByAgeConfiguration 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 ResultReuseByAgeConfiguration = ResultReuseByAgeConfiguration'
{
ResultReuseByAgeConfiguration -> Maybe Natural
maxAgeInMinutes :: Prelude.Maybe Prelude.Natural,
ResultReuseByAgeConfiguration -> Bool
enabled :: Prelude.Bool
}
deriving (ResultReuseByAgeConfiguration
-> ResultReuseByAgeConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResultReuseByAgeConfiguration
-> ResultReuseByAgeConfiguration -> Bool
$c/= :: ResultReuseByAgeConfiguration
-> ResultReuseByAgeConfiguration -> Bool
== :: ResultReuseByAgeConfiguration
-> ResultReuseByAgeConfiguration -> Bool
$c== :: ResultReuseByAgeConfiguration
-> ResultReuseByAgeConfiguration -> Bool
Prelude.Eq, ReadPrec [ResultReuseByAgeConfiguration]
ReadPrec ResultReuseByAgeConfiguration
Int -> ReadS ResultReuseByAgeConfiguration
ReadS [ResultReuseByAgeConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResultReuseByAgeConfiguration]
$creadListPrec :: ReadPrec [ResultReuseByAgeConfiguration]
readPrec :: ReadPrec ResultReuseByAgeConfiguration
$creadPrec :: ReadPrec ResultReuseByAgeConfiguration
readList :: ReadS [ResultReuseByAgeConfiguration]
$creadList :: ReadS [ResultReuseByAgeConfiguration]
readsPrec :: Int -> ReadS ResultReuseByAgeConfiguration
$creadsPrec :: Int -> ReadS ResultReuseByAgeConfiguration
Prelude.Read, Int -> ResultReuseByAgeConfiguration -> ShowS
[ResultReuseByAgeConfiguration] -> ShowS
ResultReuseByAgeConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResultReuseByAgeConfiguration] -> ShowS
$cshowList :: [ResultReuseByAgeConfiguration] -> ShowS
show :: ResultReuseByAgeConfiguration -> String
$cshow :: ResultReuseByAgeConfiguration -> String
showsPrec :: Int -> ResultReuseByAgeConfiguration -> ShowS
$cshowsPrec :: Int -> ResultReuseByAgeConfiguration -> ShowS
Prelude.Show, forall x.
Rep ResultReuseByAgeConfiguration x
-> ResultReuseByAgeConfiguration
forall x.
ResultReuseByAgeConfiguration
-> Rep ResultReuseByAgeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResultReuseByAgeConfiguration x
-> ResultReuseByAgeConfiguration
$cfrom :: forall x.
ResultReuseByAgeConfiguration
-> Rep ResultReuseByAgeConfiguration x
Prelude.Generic)
newResultReuseByAgeConfiguration ::
Prelude.Bool ->
ResultReuseByAgeConfiguration
newResultReuseByAgeConfiguration :: Bool -> ResultReuseByAgeConfiguration
newResultReuseByAgeConfiguration Bool
pEnabled_ =
ResultReuseByAgeConfiguration'
{ $sel:maxAgeInMinutes:ResultReuseByAgeConfiguration' :: Maybe Natural
maxAgeInMinutes =
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:ResultReuseByAgeConfiguration' :: Bool
enabled = Bool
pEnabled_
}
resultReuseByAgeConfiguration_maxAgeInMinutes :: Lens.Lens' ResultReuseByAgeConfiguration (Prelude.Maybe Prelude.Natural)
resultReuseByAgeConfiguration_maxAgeInMinutes :: Lens' ResultReuseByAgeConfiguration (Maybe Natural)
resultReuseByAgeConfiguration_maxAgeInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResultReuseByAgeConfiguration' {Maybe Natural
maxAgeInMinutes :: Maybe Natural
$sel:maxAgeInMinutes:ResultReuseByAgeConfiguration' :: ResultReuseByAgeConfiguration -> Maybe Natural
maxAgeInMinutes} -> Maybe Natural
maxAgeInMinutes) (\s :: ResultReuseByAgeConfiguration
s@ResultReuseByAgeConfiguration' {} Maybe Natural
a -> ResultReuseByAgeConfiguration
s {$sel:maxAgeInMinutes:ResultReuseByAgeConfiguration' :: Maybe Natural
maxAgeInMinutes = Maybe Natural
a} :: ResultReuseByAgeConfiguration)
resultReuseByAgeConfiguration_enabled :: Lens.Lens' ResultReuseByAgeConfiguration Prelude.Bool
resultReuseByAgeConfiguration_enabled :: Lens' ResultReuseByAgeConfiguration Bool
resultReuseByAgeConfiguration_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResultReuseByAgeConfiguration' {Bool
enabled :: Bool
$sel:enabled:ResultReuseByAgeConfiguration' :: ResultReuseByAgeConfiguration -> Bool
enabled} -> Bool
enabled) (\s :: ResultReuseByAgeConfiguration
s@ResultReuseByAgeConfiguration' {} Bool
a -> ResultReuseByAgeConfiguration
s {$sel:enabled:ResultReuseByAgeConfiguration' :: Bool
enabled = Bool
a} :: ResultReuseByAgeConfiguration)
instance Data.FromJSON ResultReuseByAgeConfiguration where
parseJSON :: Value -> Parser ResultReuseByAgeConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ResultReuseByAgeConfiguration"
( \Object
x ->
Maybe Natural -> Bool -> ResultReuseByAgeConfiguration
ResultReuseByAgeConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MaxAgeInMinutes")
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
"Enabled")
)
instance
Prelude.Hashable
ResultReuseByAgeConfiguration
where
hashWithSalt :: Int -> ResultReuseByAgeConfiguration -> Int
hashWithSalt Int
_salt ResultReuseByAgeConfiguration' {Bool
Maybe Natural
enabled :: Bool
maxAgeInMinutes :: Maybe Natural
$sel:enabled:ResultReuseByAgeConfiguration' :: ResultReuseByAgeConfiguration -> Bool
$sel:maxAgeInMinutes:ResultReuseByAgeConfiguration' :: ResultReuseByAgeConfiguration -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxAgeInMinutes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enabled
instance Prelude.NFData ResultReuseByAgeConfiguration where
rnf :: ResultReuseByAgeConfiguration -> ()
rnf ResultReuseByAgeConfiguration' {Bool
Maybe Natural
enabled :: Bool
maxAgeInMinutes :: Maybe Natural
$sel:enabled:ResultReuseByAgeConfiguration' :: ResultReuseByAgeConfiguration -> Bool
$sel:maxAgeInMinutes:ResultReuseByAgeConfiguration' :: ResultReuseByAgeConfiguration -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxAgeInMinutes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
enabled
instance Data.ToJSON ResultReuseByAgeConfiguration where
toJSON :: ResultReuseByAgeConfiguration -> Value
toJSON ResultReuseByAgeConfiguration' {Bool
Maybe Natural
enabled :: Bool
maxAgeInMinutes :: Maybe Natural
$sel:enabled:ResultReuseByAgeConfiguration' :: ResultReuseByAgeConfiguration -> Bool
$sel:maxAgeInMinutes:ResultReuseByAgeConfiguration' :: ResultReuseByAgeConfiguration -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxAgeInMinutes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxAgeInMinutes,
forall a. a -> Maybe a
Prelude.Just (Key
"Enabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
enabled)
]
)