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