{-# 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.QLDBSession.Types.CommitTransactionRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CommitTransactionRequest = CommitTransactionRequest'
{
CommitTransactionRequest -> Text
transactionId :: Prelude.Text,
CommitTransactionRequest -> Base64
commitDigest :: Core.Base64
}
deriving (CommitTransactionRequest -> CommitTransactionRequest -> Bool
(CommitTransactionRequest -> CommitTransactionRequest -> Bool)
-> (CommitTransactionRequest -> CommitTransactionRequest -> Bool)
-> Eq CommitTransactionRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CommitTransactionRequest -> CommitTransactionRequest -> Bool
$c/= :: CommitTransactionRequest -> CommitTransactionRequest -> Bool
== :: CommitTransactionRequest -> CommitTransactionRequest -> Bool
$c== :: CommitTransactionRequest -> CommitTransactionRequest -> Bool
Prelude.Eq, ReadPrec [CommitTransactionRequest]
ReadPrec CommitTransactionRequest
Int -> ReadS CommitTransactionRequest
ReadS [CommitTransactionRequest]
(Int -> ReadS CommitTransactionRequest)
-> ReadS [CommitTransactionRequest]
-> ReadPrec CommitTransactionRequest
-> ReadPrec [CommitTransactionRequest]
-> Read CommitTransactionRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CommitTransactionRequest]
$creadListPrec :: ReadPrec [CommitTransactionRequest]
readPrec :: ReadPrec CommitTransactionRequest
$creadPrec :: ReadPrec CommitTransactionRequest
readList :: ReadS [CommitTransactionRequest]
$creadList :: ReadS [CommitTransactionRequest]
readsPrec :: Int -> ReadS CommitTransactionRequest
$creadsPrec :: Int -> ReadS CommitTransactionRequest
Prelude.Read, Int -> CommitTransactionRequest -> ShowS
[CommitTransactionRequest] -> ShowS
CommitTransactionRequest -> String
(Int -> CommitTransactionRequest -> ShowS)
-> (CommitTransactionRequest -> String)
-> ([CommitTransactionRequest] -> ShowS)
-> Show CommitTransactionRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CommitTransactionRequest] -> ShowS
$cshowList :: [CommitTransactionRequest] -> ShowS
show :: CommitTransactionRequest -> String
$cshow :: CommitTransactionRequest -> String
showsPrec :: Int -> CommitTransactionRequest -> ShowS
$cshowsPrec :: Int -> CommitTransactionRequest -> ShowS
Prelude.Show, (forall x.
CommitTransactionRequest -> Rep CommitTransactionRequest x)
-> (forall x.
Rep CommitTransactionRequest x -> CommitTransactionRequest)
-> Generic CommitTransactionRequest
forall x.
Rep CommitTransactionRequest x -> CommitTransactionRequest
forall x.
CommitTransactionRequest -> Rep CommitTransactionRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CommitTransactionRequest x -> CommitTransactionRequest
$cfrom :: forall x.
CommitTransactionRequest -> Rep CommitTransactionRequest x
Prelude.Generic)
newCommitTransactionRequest ::
Prelude.Text ->
Prelude.ByteString ->
CommitTransactionRequest
newCommitTransactionRequest :: Text -> ByteString -> CommitTransactionRequest
newCommitTransactionRequest
Text
pTransactionId_
ByteString
pCommitDigest_ =
CommitTransactionRequest' :: Text -> Base64 -> CommitTransactionRequest
CommitTransactionRequest'
{ $sel:transactionId:CommitTransactionRequest' :: Text
transactionId =
Text
pTransactionId_,
$sel:commitDigest:CommitTransactionRequest' :: Base64
commitDigest = 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
pCommitDigest_
}
commitTransactionRequest_transactionId :: Lens.Lens' CommitTransactionRequest Prelude.Text
commitTransactionRequest_transactionId :: (Text -> f Text)
-> CommitTransactionRequest -> f CommitTransactionRequest
commitTransactionRequest_transactionId = (CommitTransactionRequest -> Text)
-> (CommitTransactionRequest -> Text -> CommitTransactionRequest)
-> Lens CommitTransactionRequest CommitTransactionRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommitTransactionRequest' {Text
transactionId :: Text
$sel:transactionId:CommitTransactionRequest' :: CommitTransactionRequest -> Text
transactionId} -> Text
transactionId) (\s :: CommitTransactionRequest
s@CommitTransactionRequest' {} Text
a -> CommitTransactionRequest
s {$sel:transactionId:CommitTransactionRequest' :: Text
transactionId = Text
a} :: CommitTransactionRequest)
commitTransactionRequest_commitDigest :: Lens.Lens' CommitTransactionRequest Prelude.ByteString
commitTransactionRequest_commitDigest :: (ByteString -> f ByteString)
-> CommitTransactionRequest -> f CommitTransactionRequest
commitTransactionRequest_commitDigest = (CommitTransactionRequest -> Base64)
-> (CommitTransactionRequest -> Base64 -> CommitTransactionRequest)
-> Lens
CommitTransactionRequest CommitTransactionRequest Base64 Base64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommitTransactionRequest' {Base64
commitDigest :: Base64
$sel:commitDigest:CommitTransactionRequest' :: CommitTransactionRequest -> Base64
commitDigest} -> Base64
commitDigest) (\s :: CommitTransactionRequest
s@CommitTransactionRequest' {} Base64
a -> CommitTransactionRequest
s {$sel:commitDigest:CommitTransactionRequest' :: Base64
commitDigest = Base64
a} :: CommitTransactionRequest) ((Base64 -> f Base64)
-> CommitTransactionRequest -> f CommitTransactionRequest)
-> ((ByteString -> f ByteString) -> Base64 -> f Base64)
-> (ByteString -> f ByteString)
-> CommitTransactionRequest
-> f CommitTransactionRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ByteString -> f ByteString) -> Base64 -> f Base64
Iso' Base64 ByteString
Core._Base64
instance Prelude.Hashable CommitTransactionRequest
instance Prelude.NFData CommitTransactionRequest
instance Core.ToJSON CommitTransactionRequest where
toJSON :: CommitTransactionRequest -> Value
toJSON CommitTransactionRequest' {Text
Base64
commitDigest :: Base64
transactionId :: Text
$sel:commitDigest:CommitTransactionRequest' :: CommitTransactionRequest -> Base64
$sel:transactionId:CommitTransactionRequest' :: CommitTransactionRequest -> 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
"TransactionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
transactionId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"CommitDigest" Text -> Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Base64
commitDigest)
]
)