{-# 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.FlinkRunConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FlinkRunConfiguration = FlinkRunConfiguration'
{
FlinkRunConfiguration -> Maybe Bool
allowNonRestoredState :: Prelude.Maybe Prelude.Bool
}
deriving (FlinkRunConfiguration -> FlinkRunConfiguration -> Bool
(FlinkRunConfiguration -> FlinkRunConfiguration -> Bool)
-> (FlinkRunConfiguration -> FlinkRunConfiguration -> Bool)
-> Eq FlinkRunConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FlinkRunConfiguration -> FlinkRunConfiguration -> Bool
$c/= :: FlinkRunConfiguration -> FlinkRunConfiguration -> Bool
== :: FlinkRunConfiguration -> FlinkRunConfiguration -> Bool
$c== :: FlinkRunConfiguration -> FlinkRunConfiguration -> Bool
Prelude.Eq, ReadPrec [FlinkRunConfiguration]
ReadPrec FlinkRunConfiguration
Int -> ReadS FlinkRunConfiguration
ReadS [FlinkRunConfiguration]
(Int -> ReadS FlinkRunConfiguration)
-> ReadS [FlinkRunConfiguration]
-> ReadPrec FlinkRunConfiguration
-> ReadPrec [FlinkRunConfiguration]
-> Read FlinkRunConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FlinkRunConfiguration]
$creadListPrec :: ReadPrec [FlinkRunConfiguration]
readPrec :: ReadPrec FlinkRunConfiguration
$creadPrec :: ReadPrec FlinkRunConfiguration
readList :: ReadS [FlinkRunConfiguration]
$creadList :: ReadS [FlinkRunConfiguration]
readsPrec :: Int -> ReadS FlinkRunConfiguration
$creadsPrec :: Int -> ReadS FlinkRunConfiguration
Prelude.Read, Int -> FlinkRunConfiguration -> ShowS
[FlinkRunConfiguration] -> ShowS
FlinkRunConfiguration -> String
(Int -> FlinkRunConfiguration -> ShowS)
-> (FlinkRunConfiguration -> String)
-> ([FlinkRunConfiguration] -> ShowS)
-> Show FlinkRunConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FlinkRunConfiguration] -> ShowS
$cshowList :: [FlinkRunConfiguration] -> ShowS
show :: FlinkRunConfiguration -> String
$cshow :: FlinkRunConfiguration -> String
showsPrec :: Int -> FlinkRunConfiguration -> ShowS
$cshowsPrec :: Int -> FlinkRunConfiguration -> ShowS
Prelude.Show, (forall x. FlinkRunConfiguration -> Rep FlinkRunConfiguration x)
-> (forall x. Rep FlinkRunConfiguration x -> FlinkRunConfiguration)
-> Generic FlinkRunConfiguration
forall x. Rep FlinkRunConfiguration x -> FlinkRunConfiguration
forall x. FlinkRunConfiguration -> Rep FlinkRunConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FlinkRunConfiguration x -> FlinkRunConfiguration
$cfrom :: forall x. FlinkRunConfiguration -> Rep FlinkRunConfiguration x
Prelude.Generic)
newFlinkRunConfiguration ::
FlinkRunConfiguration
newFlinkRunConfiguration :: FlinkRunConfiguration
newFlinkRunConfiguration =
FlinkRunConfiguration' :: Maybe Bool -> FlinkRunConfiguration
FlinkRunConfiguration'
{ $sel:allowNonRestoredState:FlinkRunConfiguration' :: Maybe Bool
allowNonRestoredState =
Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
flinkRunConfiguration_allowNonRestoredState :: Lens.Lens' FlinkRunConfiguration (Prelude.Maybe Prelude.Bool)
flinkRunConfiguration_allowNonRestoredState :: (Maybe Bool -> f (Maybe Bool))
-> FlinkRunConfiguration -> f FlinkRunConfiguration
flinkRunConfiguration_allowNonRestoredState = (FlinkRunConfiguration -> Maybe Bool)
-> (FlinkRunConfiguration -> Maybe Bool -> FlinkRunConfiguration)
-> Lens
FlinkRunConfiguration
FlinkRunConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlinkRunConfiguration' {Maybe Bool
allowNonRestoredState :: Maybe Bool
$sel:allowNonRestoredState:FlinkRunConfiguration' :: FlinkRunConfiguration -> Maybe Bool
allowNonRestoredState} -> Maybe Bool
allowNonRestoredState) (\s :: FlinkRunConfiguration
s@FlinkRunConfiguration' {} Maybe Bool
a -> FlinkRunConfiguration
s {$sel:allowNonRestoredState:FlinkRunConfiguration' :: Maybe Bool
allowNonRestoredState = Maybe Bool
a} :: FlinkRunConfiguration)
instance Core.FromJSON FlinkRunConfiguration where
parseJSON :: Value -> Parser FlinkRunConfiguration
parseJSON =
String
-> (Object -> Parser FlinkRunConfiguration)
-> Value
-> Parser FlinkRunConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FlinkRunConfiguration"
( \Object
x ->
Maybe Bool -> FlinkRunConfiguration
FlinkRunConfiguration'
(Maybe Bool -> FlinkRunConfiguration)
-> Parser (Maybe Bool) -> Parser FlinkRunConfiguration
forall (f :: * -> *) a b. Functor 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
"AllowNonRestoredState")
)
instance Prelude.Hashable FlinkRunConfiguration
instance Prelude.NFData FlinkRunConfiguration
instance Core.ToJSON FlinkRunConfiguration where
toJSON :: FlinkRunConfiguration -> Value
toJSON FlinkRunConfiguration' {Maybe Bool
allowNonRestoredState :: Maybe Bool
$sel:allowNonRestoredState:FlinkRunConfiguration' :: FlinkRunConfiguration -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AllowNonRestoredState" 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
allowNonRestoredState
]
)