{-# 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.KinesisAnalyticsV2.Types.CheckpointConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KinesisAnalyticsV2.Types.ConfigurationType
import qualified Amazonka.Prelude as Prelude
data CheckpointConfiguration = CheckpointConfiguration'
{
CheckpointConfiguration -> Maybe Natural
checkpointInterval :: Prelude.Maybe Prelude.Natural,
CheckpointConfiguration -> Maybe Bool
checkpointingEnabled :: Prelude.Maybe Prelude.Bool,
CheckpointConfiguration -> Maybe Natural
minPauseBetweenCheckpoints :: Prelude.Maybe Prelude.Natural,
CheckpointConfiguration -> ConfigurationType
configurationType :: ConfigurationType
}
deriving (CheckpointConfiguration -> CheckpointConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckpointConfiguration -> CheckpointConfiguration -> Bool
$c/= :: CheckpointConfiguration -> CheckpointConfiguration -> Bool
== :: CheckpointConfiguration -> CheckpointConfiguration -> Bool
$c== :: CheckpointConfiguration -> CheckpointConfiguration -> Bool
Prelude.Eq, ReadPrec [CheckpointConfiguration]
ReadPrec CheckpointConfiguration
Int -> ReadS CheckpointConfiguration
ReadS [CheckpointConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CheckpointConfiguration]
$creadListPrec :: ReadPrec [CheckpointConfiguration]
readPrec :: ReadPrec CheckpointConfiguration
$creadPrec :: ReadPrec CheckpointConfiguration
readList :: ReadS [CheckpointConfiguration]
$creadList :: ReadS [CheckpointConfiguration]
readsPrec :: Int -> ReadS CheckpointConfiguration
$creadsPrec :: Int -> ReadS CheckpointConfiguration
Prelude.Read, Int -> CheckpointConfiguration -> ShowS
[CheckpointConfiguration] -> ShowS
CheckpointConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CheckpointConfiguration] -> ShowS
$cshowList :: [CheckpointConfiguration] -> ShowS
show :: CheckpointConfiguration -> String
$cshow :: CheckpointConfiguration -> String
showsPrec :: Int -> CheckpointConfiguration -> ShowS
$cshowsPrec :: Int -> CheckpointConfiguration -> ShowS
Prelude.Show, forall x. Rep CheckpointConfiguration x -> CheckpointConfiguration
forall x. CheckpointConfiguration -> Rep CheckpointConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CheckpointConfiguration x -> CheckpointConfiguration
$cfrom :: forall x. CheckpointConfiguration -> Rep CheckpointConfiguration x
Prelude.Generic)
newCheckpointConfiguration ::
ConfigurationType ->
CheckpointConfiguration
newCheckpointConfiguration :: ConfigurationType -> CheckpointConfiguration
newCheckpointConfiguration ConfigurationType
pConfigurationType_ =
CheckpointConfiguration'
{ $sel:checkpointInterval:CheckpointConfiguration' :: Maybe Natural
checkpointInterval =
forall a. Maybe a
Prelude.Nothing,
$sel:checkpointingEnabled:CheckpointConfiguration' :: Maybe Bool
checkpointingEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:minPauseBetweenCheckpoints:CheckpointConfiguration' :: Maybe Natural
minPauseBetweenCheckpoints = forall a. Maybe a
Prelude.Nothing,
$sel:configurationType:CheckpointConfiguration' :: ConfigurationType
configurationType = ConfigurationType
pConfigurationType_
}
checkpointConfiguration_checkpointInterval :: Lens.Lens' CheckpointConfiguration (Prelude.Maybe Prelude.Natural)
checkpointConfiguration_checkpointInterval :: Lens' CheckpointConfiguration (Maybe Natural)
checkpointConfiguration_checkpointInterval = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckpointConfiguration' {Maybe Natural
checkpointInterval :: Maybe Natural
$sel:checkpointInterval:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Natural
checkpointInterval} -> Maybe Natural
checkpointInterval) (\s :: CheckpointConfiguration
s@CheckpointConfiguration' {} Maybe Natural
a -> CheckpointConfiguration
s {$sel:checkpointInterval:CheckpointConfiguration' :: Maybe Natural
checkpointInterval = Maybe Natural
a} :: CheckpointConfiguration)
checkpointConfiguration_checkpointingEnabled :: Lens.Lens' CheckpointConfiguration (Prelude.Maybe Prelude.Bool)
checkpointConfiguration_checkpointingEnabled :: Lens' CheckpointConfiguration (Maybe Bool)
checkpointConfiguration_checkpointingEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckpointConfiguration' {Maybe Bool
checkpointingEnabled :: Maybe Bool
$sel:checkpointingEnabled:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Bool
checkpointingEnabled} -> Maybe Bool
checkpointingEnabled) (\s :: CheckpointConfiguration
s@CheckpointConfiguration' {} Maybe Bool
a -> CheckpointConfiguration
s {$sel:checkpointingEnabled:CheckpointConfiguration' :: Maybe Bool
checkpointingEnabled = Maybe Bool
a} :: CheckpointConfiguration)
checkpointConfiguration_minPauseBetweenCheckpoints :: Lens.Lens' CheckpointConfiguration (Prelude.Maybe Prelude.Natural)
checkpointConfiguration_minPauseBetweenCheckpoints :: Lens' CheckpointConfiguration (Maybe Natural)
checkpointConfiguration_minPauseBetweenCheckpoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckpointConfiguration' {Maybe Natural
minPauseBetweenCheckpoints :: Maybe Natural
$sel:minPauseBetweenCheckpoints:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Natural
minPauseBetweenCheckpoints} -> Maybe Natural
minPauseBetweenCheckpoints) (\s :: CheckpointConfiguration
s@CheckpointConfiguration' {} Maybe Natural
a -> CheckpointConfiguration
s {$sel:minPauseBetweenCheckpoints:CheckpointConfiguration' :: Maybe Natural
minPauseBetweenCheckpoints = Maybe Natural
a} :: CheckpointConfiguration)
checkpointConfiguration_configurationType :: Lens.Lens' CheckpointConfiguration ConfigurationType
checkpointConfiguration_configurationType :: Lens' CheckpointConfiguration ConfigurationType
checkpointConfiguration_configurationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckpointConfiguration' {ConfigurationType
configurationType :: ConfigurationType
$sel:configurationType:CheckpointConfiguration' :: CheckpointConfiguration -> ConfigurationType
configurationType} -> ConfigurationType
configurationType) (\s :: CheckpointConfiguration
s@CheckpointConfiguration' {} ConfigurationType
a -> CheckpointConfiguration
s {$sel:configurationType:CheckpointConfiguration' :: ConfigurationType
configurationType = ConfigurationType
a} :: CheckpointConfiguration)
instance Prelude.Hashable CheckpointConfiguration where
hashWithSalt :: Int -> CheckpointConfiguration -> Int
hashWithSalt Int
_salt CheckpointConfiguration' {Maybe Bool
Maybe Natural
ConfigurationType
configurationType :: ConfigurationType
minPauseBetweenCheckpoints :: Maybe Natural
checkpointingEnabled :: Maybe Bool
checkpointInterval :: Maybe Natural
$sel:configurationType:CheckpointConfiguration' :: CheckpointConfiguration -> ConfigurationType
$sel:minPauseBetweenCheckpoints:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Natural
$sel:checkpointingEnabled:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Bool
$sel:checkpointInterval:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
checkpointInterval
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
checkpointingEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
minPauseBetweenCheckpoints
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ConfigurationType
configurationType
instance Prelude.NFData CheckpointConfiguration where
rnf :: CheckpointConfiguration -> ()
rnf CheckpointConfiguration' {Maybe Bool
Maybe Natural
ConfigurationType
configurationType :: ConfigurationType
minPauseBetweenCheckpoints :: Maybe Natural
checkpointingEnabled :: Maybe Bool
checkpointInterval :: Maybe Natural
$sel:configurationType:CheckpointConfiguration' :: CheckpointConfiguration -> ConfigurationType
$sel:minPauseBetweenCheckpoints:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Natural
$sel:checkpointingEnabled:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Bool
$sel:checkpointInterval:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
checkpointInterval
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
checkpointingEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
minPauseBetweenCheckpoints
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ConfigurationType
configurationType
instance Data.ToJSON CheckpointConfiguration where
toJSON :: CheckpointConfiguration -> Value
toJSON CheckpointConfiguration' {Maybe Bool
Maybe Natural
ConfigurationType
configurationType :: ConfigurationType
minPauseBetweenCheckpoints :: Maybe Natural
checkpointingEnabled :: Maybe Bool
checkpointInterval :: Maybe Natural
$sel:configurationType:CheckpointConfiguration' :: CheckpointConfiguration -> ConfigurationType
$sel:minPauseBetweenCheckpoints:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Natural
$sel:checkpointingEnabled:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Bool
$sel:checkpointInterval:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CheckpointInterval" 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
checkpointInterval,
(Key
"CheckpointingEnabled" 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 Bool
checkpointingEnabled,
(Key
"MinPauseBetweenCheckpoints" 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
minPauseBetweenCheckpoints,
forall a. a -> Maybe a
Prelude.Just
(Key
"ConfigurationType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ConfigurationType
configurationType)
]
)