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