{-# 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.Kinesis.Types.PutRecordsRequestEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PutRecordsRequestEntry = PutRecordsRequestEntry'
{
PutRecordsRequestEntry -> Maybe Text
explicitHashKey :: Prelude.Maybe Prelude.Text,
PutRecordsRequestEntry -> Base64
data' :: Core.Base64,
PutRecordsRequestEntry -> Text
partitionKey :: Prelude.Text
}
deriving (PutRecordsRequestEntry -> PutRecordsRequestEntry -> Bool
(PutRecordsRequestEntry -> PutRecordsRequestEntry -> Bool)
-> (PutRecordsRequestEntry -> PutRecordsRequestEntry -> Bool)
-> Eq PutRecordsRequestEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRecordsRequestEntry -> PutRecordsRequestEntry -> Bool
$c/= :: PutRecordsRequestEntry -> PutRecordsRequestEntry -> Bool
== :: PutRecordsRequestEntry -> PutRecordsRequestEntry -> Bool
$c== :: PutRecordsRequestEntry -> PutRecordsRequestEntry -> Bool
Prelude.Eq, ReadPrec [PutRecordsRequestEntry]
ReadPrec PutRecordsRequestEntry
Int -> ReadS PutRecordsRequestEntry
ReadS [PutRecordsRequestEntry]
(Int -> ReadS PutRecordsRequestEntry)
-> ReadS [PutRecordsRequestEntry]
-> ReadPrec PutRecordsRequestEntry
-> ReadPrec [PutRecordsRequestEntry]
-> Read PutRecordsRequestEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRecordsRequestEntry]
$creadListPrec :: ReadPrec [PutRecordsRequestEntry]
readPrec :: ReadPrec PutRecordsRequestEntry
$creadPrec :: ReadPrec PutRecordsRequestEntry
readList :: ReadS [PutRecordsRequestEntry]
$creadList :: ReadS [PutRecordsRequestEntry]
readsPrec :: Int -> ReadS PutRecordsRequestEntry
$creadsPrec :: Int -> ReadS PutRecordsRequestEntry
Prelude.Read, Int -> PutRecordsRequestEntry -> ShowS
[PutRecordsRequestEntry] -> ShowS
PutRecordsRequestEntry -> String
(Int -> PutRecordsRequestEntry -> ShowS)
-> (PutRecordsRequestEntry -> String)
-> ([PutRecordsRequestEntry] -> ShowS)
-> Show PutRecordsRequestEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRecordsRequestEntry] -> ShowS
$cshowList :: [PutRecordsRequestEntry] -> ShowS
show :: PutRecordsRequestEntry -> String
$cshow :: PutRecordsRequestEntry -> String
showsPrec :: Int -> PutRecordsRequestEntry -> ShowS
$cshowsPrec :: Int -> PutRecordsRequestEntry -> ShowS
Prelude.Show, (forall x. PutRecordsRequestEntry -> Rep PutRecordsRequestEntry x)
-> (forall x.
Rep PutRecordsRequestEntry x -> PutRecordsRequestEntry)
-> Generic PutRecordsRequestEntry
forall x. Rep PutRecordsRequestEntry x -> PutRecordsRequestEntry
forall x. PutRecordsRequestEntry -> Rep PutRecordsRequestEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutRecordsRequestEntry x -> PutRecordsRequestEntry
$cfrom :: forall x. PutRecordsRequestEntry -> Rep PutRecordsRequestEntry x
Prelude.Generic)
newPutRecordsRequestEntry ::
Prelude.ByteString ->
Prelude.Text ->
PutRecordsRequestEntry
newPutRecordsRequestEntry :: ByteString -> Text -> PutRecordsRequestEntry
newPutRecordsRequestEntry ByteString
pData_ Text
pPartitionKey_ =
PutRecordsRequestEntry' :: Maybe Text -> Base64 -> Text -> PutRecordsRequestEntry
PutRecordsRequestEntry'
{ $sel:explicitHashKey:PutRecordsRequestEntry' :: Maybe Text
explicitHashKey =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:data':PutRecordsRequestEntry' :: Base64
data' = Tagged ByteString (Identity ByteString)
-> Tagged Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64 (Tagged ByteString (Identity ByteString)
-> Tagged Base64 (Identity Base64))
-> ByteString -> Base64
forall t b. AReview t b -> b -> t
Lens.# ByteString
pData_,
$sel:partitionKey:PutRecordsRequestEntry' :: Text
partitionKey = Text
pPartitionKey_
}
putRecordsRequestEntry_explicitHashKey :: Lens.Lens' PutRecordsRequestEntry (Prelude.Maybe Prelude.Text)
putRecordsRequestEntry_explicitHashKey :: (Maybe Text -> f (Maybe Text))
-> PutRecordsRequestEntry -> f PutRecordsRequestEntry
putRecordsRequestEntry_explicitHashKey = (PutRecordsRequestEntry -> Maybe Text)
-> (PutRecordsRequestEntry -> Maybe Text -> PutRecordsRequestEntry)
-> Lens
PutRecordsRequestEntry
PutRecordsRequestEntry
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRecordsRequestEntry' {Maybe Text
explicitHashKey :: Maybe Text
$sel:explicitHashKey:PutRecordsRequestEntry' :: PutRecordsRequestEntry -> Maybe Text
explicitHashKey} -> Maybe Text
explicitHashKey) (\s :: PutRecordsRequestEntry
s@PutRecordsRequestEntry' {} Maybe Text
a -> PutRecordsRequestEntry
s {$sel:explicitHashKey:PutRecordsRequestEntry' :: Maybe Text
explicitHashKey = Maybe Text
a} :: PutRecordsRequestEntry)
putRecordsRequestEntry_data :: Lens.Lens' PutRecordsRequestEntry Prelude.ByteString
putRecordsRequestEntry_data :: (ByteString -> f ByteString)
-> PutRecordsRequestEntry -> f PutRecordsRequestEntry
putRecordsRequestEntry_data = (PutRecordsRequestEntry -> Base64)
-> (PutRecordsRequestEntry -> Base64 -> PutRecordsRequestEntry)
-> Lens PutRecordsRequestEntry PutRecordsRequestEntry Base64 Base64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRecordsRequestEntry' {Base64
data' :: Base64
$sel:data':PutRecordsRequestEntry' :: PutRecordsRequestEntry -> Base64
data'} -> Base64
data') (\s :: PutRecordsRequestEntry
s@PutRecordsRequestEntry' {} Base64
a -> PutRecordsRequestEntry
s {$sel:data':PutRecordsRequestEntry' :: Base64
data' = Base64
a} :: PutRecordsRequestEntry) ((Base64 -> f Base64)
-> PutRecordsRequestEntry -> f PutRecordsRequestEntry)
-> ((ByteString -> f ByteString) -> Base64 -> f Base64)
-> (ByteString -> f ByteString)
-> PutRecordsRequestEntry
-> f PutRecordsRequestEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ByteString -> f ByteString) -> Base64 -> f Base64
Iso' Base64 ByteString
Core._Base64
putRecordsRequestEntry_partitionKey :: Lens.Lens' PutRecordsRequestEntry Prelude.Text
putRecordsRequestEntry_partitionKey :: (Text -> f Text)
-> PutRecordsRequestEntry -> f PutRecordsRequestEntry
putRecordsRequestEntry_partitionKey = (PutRecordsRequestEntry -> Text)
-> (PutRecordsRequestEntry -> Text -> PutRecordsRequestEntry)
-> Lens PutRecordsRequestEntry PutRecordsRequestEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRecordsRequestEntry' {Text
partitionKey :: Text
$sel:partitionKey:PutRecordsRequestEntry' :: PutRecordsRequestEntry -> Text
partitionKey} -> Text
partitionKey) (\s :: PutRecordsRequestEntry
s@PutRecordsRequestEntry' {} Text
a -> PutRecordsRequestEntry
s {$sel:partitionKey:PutRecordsRequestEntry' :: Text
partitionKey = Text
a} :: PutRecordsRequestEntry)
instance Prelude.Hashable PutRecordsRequestEntry
instance Prelude.NFData PutRecordsRequestEntry
instance Core.ToJSON PutRecordsRequestEntry where
toJSON :: PutRecordsRequestEntry -> Value
toJSON PutRecordsRequestEntry' {Maybe Text
Text
Base64
partitionKey :: Text
data' :: Base64
explicitHashKey :: Maybe Text
$sel:partitionKey:PutRecordsRequestEntry' :: PutRecordsRequestEntry -> Text
$sel:data':PutRecordsRequestEntry' :: PutRecordsRequestEntry -> Base64
$sel:explicitHashKey:PutRecordsRequestEntry' :: PutRecordsRequestEntry -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ExplicitHashKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
explicitHashKey,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Data" Text -> Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Base64
data'),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PartitionKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
partitionKey)
]
)