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