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