{-# 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.StartTransactionResult where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QLDBSession.Types.TimingInformation
data StartTransactionResult = StartTransactionResult'
{
StartTransactionResult -> Maybe TimingInformation
timingInformation :: Prelude.Maybe TimingInformation,
StartTransactionResult -> Maybe Text
transactionId :: Prelude.Maybe Prelude.Text
}
deriving (StartTransactionResult -> StartTransactionResult -> Bool
(StartTransactionResult -> StartTransactionResult -> Bool)
-> (StartTransactionResult -> StartTransactionResult -> Bool)
-> Eq StartTransactionResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTransactionResult -> StartTransactionResult -> Bool
$c/= :: StartTransactionResult -> StartTransactionResult -> Bool
== :: StartTransactionResult -> StartTransactionResult -> Bool
$c== :: StartTransactionResult -> StartTransactionResult -> Bool
Prelude.Eq, ReadPrec [StartTransactionResult]
ReadPrec StartTransactionResult
Int -> ReadS StartTransactionResult
ReadS [StartTransactionResult]
(Int -> ReadS StartTransactionResult)
-> ReadS [StartTransactionResult]
-> ReadPrec StartTransactionResult
-> ReadPrec [StartTransactionResult]
-> Read StartTransactionResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTransactionResult]
$creadListPrec :: ReadPrec [StartTransactionResult]
readPrec :: ReadPrec StartTransactionResult
$creadPrec :: ReadPrec StartTransactionResult
readList :: ReadS [StartTransactionResult]
$creadList :: ReadS [StartTransactionResult]
readsPrec :: Int -> ReadS StartTransactionResult
$creadsPrec :: Int -> ReadS StartTransactionResult
Prelude.Read, Int -> StartTransactionResult -> ShowS
[StartTransactionResult] -> ShowS
StartTransactionResult -> String
(Int -> StartTransactionResult -> ShowS)
-> (StartTransactionResult -> String)
-> ([StartTransactionResult] -> ShowS)
-> Show StartTransactionResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTransactionResult] -> ShowS
$cshowList :: [StartTransactionResult] -> ShowS
show :: StartTransactionResult -> String
$cshow :: StartTransactionResult -> String
showsPrec :: Int -> StartTransactionResult -> ShowS
$cshowsPrec :: Int -> StartTransactionResult -> ShowS
Prelude.Show, (forall x. StartTransactionResult -> Rep StartTransactionResult x)
-> (forall x.
Rep StartTransactionResult x -> StartTransactionResult)
-> Generic StartTransactionResult
forall x. Rep StartTransactionResult x -> StartTransactionResult
forall x. StartTransactionResult -> Rep StartTransactionResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartTransactionResult x -> StartTransactionResult
$cfrom :: forall x. StartTransactionResult -> Rep StartTransactionResult x
Prelude.Generic)
newStartTransactionResult ::
StartTransactionResult
newStartTransactionResult :: StartTransactionResult
newStartTransactionResult =
StartTransactionResult' :: Maybe TimingInformation -> Maybe Text -> StartTransactionResult
StartTransactionResult'
{ $sel:timingInformation:StartTransactionResult' :: Maybe TimingInformation
timingInformation =
Maybe TimingInformation
forall a. Maybe a
Prelude.Nothing,
$sel:transactionId:StartTransactionResult' :: Maybe Text
transactionId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
startTransactionResult_timingInformation :: Lens.Lens' StartTransactionResult (Prelude.Maybe TimingInformation)
startTransactionResult_timingInformation :: (Maybe TimingInformation -> f (Maybe TimingInformation))
-> StartTransactionResult -> f StartTransactionResult
startTransactionResult_timingInformation = (StartTransactionResult -> Maybe TimingInformation)
-> (StartTransactionResult
-> Maybe TimingInformation -> StartTransactionResult)
-> Lens
StartTransactionResult
StartTransactionResult
(Maybe TimingInformation)
(Maybe TimingInformation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTransactionResult' {Maybe TimingInformation
timingInformation :: Maybe TimingInformation
$sel:timingInformation:StartTransactionResult' :: StartTransactionResult -> Maybe TimingInformation
timingInformation} -> Maybe TimingInformation
timingInformation) (\s :: StartTransactionResult
s@StartTransactionResult' {} Maybe TimingInformation
a -> StartTransactionResult
s {$sel:timingInformation:StartTransactionResult' :: Maybe TimingInformation
timingInformation = Maybe TimingInformation
a} :: StartTransactionResult)
startTransactionResult_transactionId :: Lens.Lens' StartTransactionResult (Prelude.Maybe Prelude.Text)
startTransactionResult_transactionId :: (Maybe Text -> f (Maybe Text))
-> StartTransactionResult -> f StartTransactionResult
startTransactionResult_transactionId = (StartTransactionResult -> Maybe Text)
-> (StartTransactionResult -> Maybe Text -> StartTransactionResult)
-> Lens
StartTransactionResult
StartTransactionResult
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTransactionResult' {Maybe Text
transactionId :: Maybe Text
$sel:transactionId:StartTransactionResult' :: StartTransactionResult -> Maybe Text
transactionId} -> Maybe Text
transactionId) (\s :: StartTransactionResult
s@StartTransactionResult' {} Maybe Text
a -> StartTransactionResult
s {$sel:transactionId:StartTransactionResult' :: Maybe Text
transactionId = Maybe Text
a} :: StartTransactionResult)
instance Core.FromJSON StartTransactionResult where
parseJSON :: Value -> Parser StartTransactionResult
parseJSON =
String
-> (Object -> Parser StartTransactionResult)
-> Value
-> Parser StartTransactionResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StartTransactionResult"
( \Object
x ->
Maybe TimingInformation -> Maybe Text -> StartTransactionResult
StartTransactionResult'
(Maybe TimingInformation -> Maybe Text -> StartTransactionResult)
-> Parser (Maybe TimingInformation)
-> Parser (Maybe Text -> StartTransactionResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TimingInformation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TimingInformation")
Parser (Maybe Text -> StartTransactionResult)
-> Parser (Maybe Text) -> Parser StartTransactionResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TransactionId")
)
instance Prelude.Hashable StartTransactionResult
instance Prelude.NFData StartTransactionResult