{-# 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.RunConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.ApplicationRestoreConfiguration
import Amazonka.KinesisAnalyticsV2.Types.FlinkRunConfiguration
import Amazonka.KinesisAnalyticsV2.Types.SqlRunConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RunConfiguration = RunConfiguration'
{
RunConfiguration -> Maybe [SqlRunConfiguration]
sqlRunConfigurations :: Prelude.Maybe [SqlRunConfiguration],
RunConfiguration -> Maybe FlinkRunConfiguration
flinkRunConfiguration :: Prelude.Maybe FlinkRunConfiguration,
RunConfiguration -> Maybe ApplicationRestoreConfiguration
applicationRestoreConfiguration :: Prelude.Maybe ApplicationRestoreConfiguration
}
deriving (RunConfiguration -> RunConfiguration -> Bool
(RunConfiguration -> RunConfiguration -> Bool)
-> (RunConfiguration -> RunConfiguration -> Bool)
-> Eq RunConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RunConfiguration -> RunConfiguration -> Bool
$c/= :: RunConfiguration -> RunConfiguration -> Bool
== :: RunConfiguration -> RunConfiguration -> Bool
$c== :: RunConfiguration -> RunConfiguration -> Bool
Prelude.Eq, ReadPrec [RunConfiguration]
ReadPrec RunConfiguration
Int -> ReadS RunConfiguration
ReadS [RunConfiguration]
(Int -> ReadS RunConfiguration)
-> ReadS [RunConfiguration]
-> ReadPrec RunConfiguration
-> ReadPrec [RunConfiguration]
-> Read RunConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RunConfiguration]
$creadListPrec :: ReadPrec [RunConfiguration]
readPrec :: ReadPrec RunConfiguration
$creadPrec :: ReadPrec RunConfiguration
readList :: ReadS [RunConfiguration]
$creadList :: ReadS [RunConfiguration]
readsPrec :: Int -> ReadS RunConfiguration
$creadsPrec :: Int -> ReadS RunConfiguration
Prelude.Read, Int -> RunConfiguration -> ShowS
[RunConfiguration] -> ShowS
RunConfiguration -> String
(Int -> RunConfiguration -> ShowS)
-> (RunConfiguration -> String)
-> ([RunConfiguration] -> ShowS)
-> Show RunConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RunConfiguration] -> ShowS
$cshowList :: [RunConfiguration] -> ShowS
show :: RunConfiguration -> String
$cshow :: RunConfiguration -> String
showsPrec :: Int -> RunConfiguration -> ShowS
$cshowsPrec :: Int -> RunConfiguration -> ShowS
Prelude.Show, (forall x. RunConfiguration -> Rep RunConfiguration x)
-> (forall x. Rep RunConfiguration x -> RunConfiguration)
-> Generic RunConfiguration
forall x. Rep RunConfiguration x -> RunConfiguration
forall x. RunConfiguration -> Rep RunConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RunConfiguration x -> RunConfiguration
$cfrom :: forall x. RunConfiguration -> Rep RunConfiguration x
Prelude.Generic)
newRunConfiguration ::
RunConfiguration
newRunConfiguration :: RunConfiguration
newRunConfiguration =
RunConfiguration' :: Maybe [SqlRunConfiguration]
-> Maybe FlinkRunConfiguration
-> Maybe ApplicationRestoreConfiguration
-> RunConfiguration
RunConfiguration'
{ $sel:sqlRunConfigurations:RunConfiguration' :: Maybe [SqlRunConfiguration]
sqlRunConfigurations =
Maybe [SqlRunConfiguration]
forall a. Maybe a
Prelude.Nothing,
$sel:flinkRunConfiguration:RunConfiguration' :: Maybe FlinkRunConfiguration
flinkRunConfiguration = Maybe FlinkRunConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:applicationRestoreConfiguration:RunConfiguration' :: Maybe ApplicationRestoreConfiguration
applicationRestoreConfiguration = Maybe ApplicationRestoreConfiguration
forall a. Maybe a
Prelude.Nothing
}
runConfiguration_sqlRunConfigurations :: Lens.Lens' RunConfiguration (Prelude.Maybe [SqlRunConfiguration])
runConfiguration_sqlRunConfigurations :: (Maybe [SqlRunConfiguration] -> f (Maybe [SqlRunConfiguration]))
-> RunConfiguration -> f RunConfiguration
runConfiguration_sqlRunConfigurations = (RunConfiguration -> Maybe [SqlRunConfiguration])
-> (RunConfiguration
-> Maybe [SqlRunConfiguration] -> RunConfiguration)
-> Lens
RunConfiguration
RunConfiguration
(Maybe [SqlRunConfiguration])
(Maybe [SqlRunConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunConfiguration' {Maybe [SqlRunConfiguration]
sqlRunConfigurations :: Maybe [SqlRunConfiguration]
$sel:sqlRunConfigurations:RunConfiguration' :: RunConfiguration -> Maybe [SqlRunConfiguration]
sqlRunConfigurations} -> Maybe [SqlRunConfiguration]
sqlRunConfigurations) (\s :: RunConfiguration
s@RunConfiguration' {} Maybe [SqlRunConfiguration]
a -> RunConfiguration
s {$sel:sqlRunConfigurations:RunConfiguration' :: Maybe [SqlRunConfiguration]
sqlRunConfigurations = Maybe [SqlRunConfiguration]
a} :: RunConfiguration) ((Maybe [SqlRunConfiguration] -> f (Maybe [SqlRunConfiguration]))
-> RunConfiguration -> f RunConfiguration)
-> ((Maybe [SqlRunConfiguration]
-> f (Maybe [SqlRunConfiguration]))
-> Maybe [SqlRunConfiguration] -> f (Maybe [SqlRunConfiguration]))
-> (Maybe [SqlRunConfiguration] -> f (Maybe [SqlRunConfiguration]))
-> RunConfiguration
-> f RunConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SqlRunConfiguration]
[SqlRunConfiguration]
[SqlRunConfiguration]
[SqlRunConfiguration]
-> Iso
(Maybe [SqlRunConfiguration])
(Maybe [SqlRunConfiguration])
(Maybe [SqlRunConfiguration])
(Maybe [SqlRunConfiguration])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[SqlRunConfiguration]
[SqlRunConfiguration]
[SqlRunConfiguration]
[SqlRunConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
runConfiguration_flinkRunConfiguration :: Lens.Lens' RunConfiguration (Prelude.Maybe FlinkRunConfiguration)
runConfiguration_flinkRunConfiguration :: (Maybe FlinkRunConfiguration -> f (Maybe FlinkRunConfiguration))
-> RunConfiguration -> f RunConfiguration
runConfiguration_flinkRunConfiguration = (RunConfiguration -> Maybe FlinkRunConfiguration)
-> (RunConfiguration
-> Maybe FlinkRunConfiguration -> RunConfiguration)
-> Lens
RunConfiguration
RunConfiguration
(Maybe FlinkRunConfiguration)
(Maybe FlinkRunConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunConfiguration' {Maybe FlinkRunConfiguration
flinkRunConfiguration :: Maybe FlinkRunConfiguration
$sel:flinkRunConfiguration:RunConfiguration' :: RunConfiguration -> Maybe FlinkRunConfiguration
flinkRunConfiguration} -> Maybe FlinkRunConfiguration
flinkRunConfiguration) (\s :: RunConfiguration
s@RunConfiguration' {} Maybe FlinkRunConfiguration
a -> RunConfiguration
s {$sel:flinkRunConfiguration:RunConfiguration' :: Maybe FlinkRunConfiguration
flinkRunConfiguration = Maybe FlinkRunConfiguration
a} :: RunConfiguration)
runConfiguration_applicationRestoreConfiguration :: Lens.Lens' RunConfiguration (Prelude.Maybe ApplicationRestoreConfiguration)
runConfiguration_applicationRestoreConfiguration :: (Maybe ApplicationRestoreConfiguration
-> f (Maybe ApplicationRestoreConfiguration))
-> RunConfiguration -> f RunConfiguration
runConfiguration_applicationRestoreConfiguration = (RunConfiguration -> Maybe ApplicationRestoreConfiguration)
-> (RunConfiguration
-> Maybe ApplicationRestoreConfiguration -> RunConfiguration)
-> Lens
RunConfiguration
RunConfiguration
(Maybe ApplicationRestoreConfiguration)
(Maybe ApplicationRestoreConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunConfiguration' {Maybe ApplicationRestoreConfiguration
applicationRestoreConfiguration :: Maybe ApplicationRestoreConfiguration
$sel:applicationRestoreConfiguration:RunConfiguration' :: RunConfiguration -> Maybe ApplicationRestoreConfiguration
applicationRestoreConfiguration} -> Maybe ApplicationRestoreConfiguration
applicationRestoreConfiguration) (\s :: RunConfiguration
s@RunConfiguration' {} Maybe ApplicationRestoreConfiguration
a -> RunConfiguration
s {$sel:applicationRestoreConfiguration:RunConfiguration' :: Maybe ApplicationRestoreConfiguration
applicationRestoreConfiguration = Maybe ApplicationRestoreConfiguration
a} :: RunConfiguration)
instance Prelude.Hashable RunConfiguration
instance Prelude.NFData RunConfiguration
instance Core.ToJSON RunConfiguration where
toJSON :: RunConfiguration -> Value
toJSON RunConfiguration' {Maybe [SqlRunConfiguration]
Maybe ApplicationRestoreConfiguration
Maybe FlinkRunConfiguration
applicationRestoreConfiguration :: Maybe ApplicationRestoreConfiguration
flinkRunConfiguration :: Maybe FlinkRunConfiguration
sqlRunConfigurations :: Maybe [SqlRunConfiguration]
$sel:applicationRestoreConfiguration:RunConfiguration' :: RunConfiguration -> Maybe ApplicationRestoreConfiguration
$sel:flinkRunConfiguration:RunConfiguration' :: RunConfiguration -> Maybe FlinkRunConfiguration
$sel:sqlRunConfigurations:RunConfiguration' :: RunConfiguration -> Maybe [SqlRunConfiguration]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SqlRunConfigurations" Text -> [SqlRunConfiguration] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([SqlRunConfiguration] -> Pair)
-> Maybe [SqlRunConfiguration] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SqlRunConfiguration]
sqlRunConfigurations,
(Text
"FlinkRunConfiguration" Text -> FlinkRunConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(FlinkRunConfiguration -> Pair)
-> Maybe FlinkRunConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FlinkRunConfiguration
flinkRunConfiguration,
(Text
"ApplicationRestoreConfiguration" Text -> ApplicationRestoreConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ApplicationRestoreConfiguration -> Pair)
-> Maybe ApplicationRestoreConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ApplicationRestoreConfiguration
applicationRestoreConfiguration
]
)