{-# 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.FetchPageResult 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 =
{
:: Prelude.Maybe TimingInformation,
:: Prelude.Maybe IOUsage,
:: Prelude.Maybe Page
}
deriving (FetchPageResult -> FetchPageResult -> Bool
(FetchPageResult -> FetchPageResult -> Bool)
-> (FetchPageResult -> FetchPageResult -> Bool)
-> Eq FetchPageResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FetchPageResult -> FetchPageResult -> Bool
$c/= :: FetchPageResult -> FetchPageResult -> Bool
== :: FetchPageResult -> FetchPageResult -> Bool
$c== :: FetchPageResult -> FetchPageResult -> Bool
Prelude.Eq, ReadPrec [FetchPageResult]
ReadPrec FetchPageResult
Int -> ReadS FetchPageResult
ReadS [FetchPageResult]
(Int -> ReadS FetchPageResult)
-> ReadS [FetchPageResult]
-> ReadPrec FetchPageResult
-> ReadPrec [FetchPageResult]
-> Read FetchPageResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FetchPageResult]
$creadListPrec :: ReadPrec [FetchPageResult]
readPrec :: ReadPrec FetchPageResult
$creadPrec :: ReadPrec FetchPageResult
readList :: ReadS [FetchPageResult]
$creadList :: ReadS [FetchPageResult]
readsPrec :: Int -> ReadS FetchPageResult
$creadsPrec :: Int -> ReadS FetchPageResult
Prelude.Read, Int -> FetchPageResult -> ShowS
[FetchPageResult] -> ShowS
FetchPageResult -> String
(Int -> FetchPageResult -> ShowS)
-> (FetchPageResult -> String)
-> ([FetchPageResult] -> ShowS)
-> Show FetchPageResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FetchPageResult] -> ShowS
$cshowList :: [FetchPageResult] -> ShowS
show :: FetchPageResult -> String
$cshow :: FetchPageResult -> String
showsPrec :: Int -> FetchPageResult -> ShowS
$cshowsPrec :: Int -> FetchPageResult -> ShowS
Prelude.Show, (forall x. FetchPageResult -> Rep FetchPageResult x)
-> (forall x. Rep FetchPageResult x -> FetchPageResult)
-> Generic FetchPageResult
forall x. Rep FetchPageResult x -> FetchPageResult
forall x. FetchPageResult -> Rep FetchPageResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FetchPageResult x -> FetchPageResult
$cfrom :: forall x. FetchPageResult -> Rep FetchPageResult x
Prelude.Generic)
newFetchPageResult ::
FetchPageResult
=
FetchPageResult' :: Maybe TimingInformation
-> Maybe IOUsage -> Maybe Page -> FetchPageResult
FetchPageResult'
{ $sel:timingInformation:FetchPageResult' :: Maybe TimingInformation
timingInformation =
Maybe TimingInformation
forall a. Maybe a
Prelude.Nothing,
$sel:consumedIOs:FetchPageResult' :: Maybe IOUsage
consumedIOs = Maybe IOUsage
forall a. Maybe a
Prelude.Nothing,
$sel:page:FetchPageResult' :: Maybe Page
page = Maybe Page
forall a. Maybe a
Prelude.Nothing
}
fetchPageResult_timingInformation :: Lens.Lens' FetchPageResult (Prelude.Maybe TimingInformation)
= (FetchPageResult -> Maybe TimingInformation)
-> (FetchPageResult -> Maybe TimingInformation -> FetchPageResult)
-> Lens
FetchPageResult
FetchPageResult
(Maybe TimingInformation)
(Maybe TimingInformation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FetchPageResult' {Maybe TimingInformation
timingInformation :: Maybe TimingInformation
$sel:timingInformation:FetchPageResult' :: FetchPageResult -> Maybe TimingInformation
timingInformation} -> Maybe TimingInformation
timingInformation) (\s :: FetchPageResult
s@FetchPageResult' {} Maybe TimingInformation
a -> FetchPageResult
s {$sel:timingInformation:FetchPageResult' :: Maybe TimingInformation
timingInformation = Maybe TimingInformation
a} :: FetchPageResult)
fetchPageResult_consumedIOs :: Lens.Lens' FetchPageResult (Prelude.Maybe IOUsage)
= (FetchPageResult -> Maybe IOUsage)
-> (FetchPageResult -> Maybe IOUsage -> FetchPageResult)
-> Lens
FetchPageResult FetchPageResult (Maybe IOUsage) (Maybe IOUsage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FetchPageResult' {Maybe IOUsage
consumedIOs :: Maybe IOUsage
$sel:consumedIOs:FetchPageResult' :: FetchPageResult -> Maybe IOUsage
consumedIOs} -> Maybe IOUsage
consumedIOs) (\s :: FetchPageResult
s@FetchPageResult' {} Maybe IOUsage
a -> FetchPageResult
s {$sel:consumedIOs:FetchPageResult' :: Maybe IOUsage
consumedIOs = Maybe IOUsage
a} :: FetchPageResult)
fetchPageResult_page :: Lens.Lens' FetchPageResult (Prelude.Maybe Page)
= (FetchPageResult -> Maybe Page)
-> (FetchPageResult -> Maybe Page -> FetchPageResult)
-> Lens FetchPageResult FetchPageResult (Maybe Page) (Maybe Page)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FetchPageResult' {Maybe Page
page :: Maybe Page
$sel:page:FetchPageResult' :: FetchPageResult -> Maybe Page
page} -> Maybe Page
page) (\s :: FetchPageResult
s@FetchPageResult' {} Maybe Page
a -> FetchPageResult
s {$sel:page:FetchPageResult' :: Maybe Page
page = Maybe Page
a} :: FetchPageResult)
instance Core.FromJSON FetchPageResult where
parseJSON :: Value -> Parser FetchPageResult
parseJSON =
String
-> (Object -> Parser FetchPageResult)
-> Value
-> Parser FetchPageResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FetchPageResult"
( \Object
x ->
Maybe TimingInformation
-> Maybe IOUsage -> Maybe Page -> FetchPageResult
FetchPageResult'
(Maybe TimingInformation
-> Maybe IOUsage -> Maybe Page -> FetchPageResult)
-> Parser (Maybe TimingInformation)
-> Parser (Maybe IOUsage -> Maybe Page -> FetchPageResult)
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 -> FetchPageResult)
-> Parser (Maybe IOUsage) -> Parser (Maybe Page -> FetchPageResult)
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 -> FetchPageResult)
-> Parser (Maybe Page) -> Parser FetchPageResult
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
"Page")
)
instance Prelude.Hashable FetchPageResult
instance Prelude.NFData FetchPageResult