{-# 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 Amazonka.KinesisAnalyticsV2.Types.ConfigurationType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CheckpointConfiguration = CheckpointConfiguration'
{
CheckpointConfiguration -> Maybe Bool
checkpointingEnabled :: Prelude.Maybe Prelude.Bool,
CheckpointConfiguration -> Maybe Natural
minPauseBetweenCheckpoints :: Prelude.Maybe Prelude.Natural,
CheckpointConfiguration -> Maybe Natural
checkpointInterval :: Prelude.Maybe Prelude.Natural,
CheckpointConfiguration -> ConfigurationType
configurationType :: ConfigurationType
}
deriving (CheckpointConfiguration -> CheckpointConfiguration -> Bool
(CheckpointConfiguration -> CheckpointConfiguration -> Bool)
-> (CheckpointConfiguration -> CheckpointConfiguration -> Bool)
-> Eq CheckpointConfiguration
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]
(Int -> ReadS CheckpointConfiguration)
-> ReadS [CheckpointConfiguration]
-> ReadPrec CheckpointConfiguration
-> ReadPrec [CheckpointConfiguration]
-> Read 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
(Int -> CheckpointConfiguration -> ShowS)
-> (CheckpointConfiguration -> String)
-> ([CheckpointConfiguration] -> ShowS)
-> Show CheckpointConfiguration
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.
CheckpointConfiguration -> Rep CheckpointConfiguration x)
-> (forall x.
Rep CheckpointConfiguration x -> CheckpointConfiguration)
-> Generic CheckpointConfiguration
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' :: Maybe Bool
-> Maybe Natural
-> Maybe Natural
-> ConfigurationType
-> CheckpointConfiguration
CheckpointConfiguration'
{ $sel:checkpointingEnabled:CheckpointConfiguration' :: Maybe Bool
checkpointingEnabled =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:minPauseBetweenCheckpoints:CheckpointConfiguration' :: Maybe Natural
minPauseBetweenCheckpoints = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:checkpointInterval:CheckpointConfiguration' :: Maybe Natural
checkpointInterval = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:configurationType:CheckpointConfiguration' :: ConfigurationType
configurationType = ConfigurationType
pConfigurationType_
}
checkpointConfiguration_checkpointingEnabled :: Lens.Lens' CheckpointConfiguration (Prelude.Maybe Prelude.Bool)
checkpointConfiguration_checkpointingEnabled :: (Maybe Bool -> f (Maybe Bool))
-> CheckpointConfiguration -> f CheckpointConfiguration
checkpointConfiguration_checkpointingEnabled = (CheckpointConfiguration -> Maybe Bool)
-> (CheckpointConfiguration
-> Maybe Bool -> CheckpointConfiguration)
-> Lens
CheckpointConfiguration
CheckpointConfiguration
(Maybe Bool)
(Maybe Bool)
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 :: (Maybe Natural -> f (Maybe Natural))
-> CheckpointConfiguration -> f CheckpointConfiguration
checkpointConfiguration_minPauseBetweenCheckpoints = (CheckpointConfiguration -> Maybe Natural)
-> (CheckpointConfiguration
-> Maybe Natural -> CheckpointConfiguration)
-> Lens
CheckpointConfiguration
CheckpointConfiguration
(Maybe Natural)
(Maybe Natural)
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_checkpointInterval :: Lens.Lens' CheckpointConfiguration (Prelude.Maybe Prelude.Natural)
checkpointConfiguration_checkpointInterval :: (Maybe Natural -> f (Maybe Natural))
-> CheckpointConfiguration -> f CheckpointConfiguration
checkpointConfiguration_checkpointInterval = (CheckpointConfiguration -> Maybe Natural)
-> (CheckpointConfiguration
-> Maybe Natural -> CheckpointConfiguration)
-> Lens
CheckpointConfiguration
CheckpointConfiguration
(Maybe Natural)
(Maybe Natural)
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_configurationType :: Lens.Lens' CheckpointConfiguration ConfigurationType
checkpointConfiguration_configurationType :: (ConfigurationType -> f ConfigurationType)
-> CheckpointConfiguration -> f CheckpointConfiguration
checkpointConfiguration_configurationType = (CheckpointConfiguration -> ConfigurationType)
-> (CheckpointConfiguration
-> ConfigurationType -> CheckpointConfiguration)
-> Lens
CheckpointConfiguration
CheckpointConfiguration
ConfigurationType
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
instance Prelude.NFData CheckpointConfiguration
instance Core.ToJSON CheckpointConfiguration where
toJSON :: CheckpointConfiguration -> Value
toJSON CheckpointConfiguration' {Maybe Bool
Maybe Natural
ConfigurationType
configurationType :: ConfigurationType
checkpointInterval :: Maybe Natural
minPauseBetweenCheckpoints :: Maybe Natural
checkpointingEnabled :: Maybe Bool
$sel:configurationType:CheckpointConfiguration' :: CheckpointConfiguration -> ConfigurationType
$sel:checkpointInterval:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Natural
$sel:minPauseBetweenCheckpoints:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Natural
$sel:checkpointingEnabled:CheckpointConfiguration' :: CheckpointConfiguration -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CheckpointingEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
checkpointingEnabled,
(Text
"MinPauseBetweenCheckpoints" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
minPauseBetweenCheckpoints,
(Text
"CheckpointInterval" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
checkpointInterval,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ConfigurationType" Text -> ConfigurationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConfigurationType
configurationType)
]
)