{-# 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.DynamoDB.Types.ProvisionedThroughputDescription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ProvisionedThroughputDescription = ProvisionedThroughputDescription'
{
ProvisionedThroughputDescription -> Maybe Natural
readCapacityUnits :: Prelude.Maybe Prelude.Natural,
ProvisionedThroughputDescription -> Maybe POSIX
lastDecreaseDateTime :: Prelude.Maybe Core.POSIX,
ProvisionedThroughputDescription -> Maybe Natural
writeCapacityUnits :: Prelude.Maybe Prelude.Natural,
ProvisionedThroughputDescription -> Maybe Natural
numberOfDecreasesToday :: Prelude.Maybe Prelude.Natural,
ProvisionedThroughputDescription -> Maybe POSIX
lastIncreaseDateTime :: Prelude.Maybe Core.POSIX
}
deriving (ProvisionedThroughputDescription
-> ProvisionedThroughputDescription -> Bool
(ProvisionedThroughputDescription
-> ProvisionedThroughputDescription -> Bool)
-> (ProvisionedThroughputDescription
-> ProvisionedThroughputDescription -> Bool)
-> Eq ProvisionedThroughputDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisionedThroughputDescription
-> ProvisionedThroughputDescription -> Bool
$c/= :: ProvisionedThroughputDescription
-> ProvisionedThroughputDescription -> Bool
== :: ProvisionedThroughputDescription
-> ProvisionedThroughputDescription -> Bool
$c== :: ProvisionedThroughputDescription
-> ProvisionedThroughputDescription -> Bool
Prelude.Eq, ReadPrec [ProvisionedThroughputDescription]
ReadPrec ProvisionedThroughputDescription
Int -> ReadS ProvisionedThroughputDescription
ReadS [ProvisionedThroughputDescription]
(Int -> ReadS ProvisionedThroughputDescription)
-> ReadS [ProvisionedThroughputDescription]
-> ReadPrec ProvisionedThroughputDescription
-> ReadPrec [ProvisionedThroughputDescription]
-> Read ProvisionedThroughputDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisionedThroughputDescription]
$creadListPrec :: ReadPrec [ProvisionedThroughputDescription]
readPrec :: ReadPrec ProvisionedThroughputDescription
$creadPrec :: ReadPrec ProvisionedThroughputDescription
readList :: ReadS [ProvisionedThroughputDescription]
$creadList :: ReadS [ProvisionedThroughputDescription]
readsPrec :: Int -> ReadS ProvisionedThroughputDescription
$creadsPrec :: Int -> ReadS ProvisionedThroughputDescription
Prelude.Read, Int -> ProvisionedThroughputDescription -> ShowS
[ProvisionedThroughputDescription] -> ShowS
ProvisionedThroughputDescription -> String
(Int -> ProvisionedThroughputDescription -> ShowS)
-> (ProvisionedThroughputDescription -> String)
-> ([ProvisionedThroughputDescription] -> ShowS)
-> Show ProvisionedThroughputDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisionedThroughputDescription] -> ShowS
$cshowList :: [ProvisionedThroughputDescription] -> ShowS
show :: ProvisionedThroughputDescription -> String
$cshow :: ProvisionedThroughputDescription -> String
showsPrec :: Int -> ProvisionedThroughputDescription -> ShowS
$cshowsPrec :: Int -> ProvisionedThroughputDescription -> ShowS
Prelude.Show, (forall x.
ProvisionedThroughputDescription
-> Rep ProvisionedThroughputDescription x)
-> (forall x.
Rep ProvisionedThroughputDescription x
-> ProvisionedThroughputDescription)
-> Generic ProvisionedThroughputDescription
forall x.
Rep ProvisionedThroughputDescription x
-> ProvisionedThroughputDescription
forall x.
ProvisionedThroughputDescription
-> Rep ProvisionedThroughputDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisionedThroughputDescription x
-> ProvisionedThroughputDescription
$cfrom :: forall x.
ProvisionedThroughputDescription
-> Rep ProvisionedThroughputDescription x
Prelude.Generic)
newProvisionedThroughputDescription ::
ProvisionedThroughputDescription
newProvisionedThroughputDescription :: ProvisionedThroughputDescription
newProvisionedThroughputDescription =
ProvisionedThroughputDescription' :: Maybe Natural
-> Maybe POSIX
-> Maybe Natural
-> Maybe Natural
-> Maybe POSIX
-> ProvisionedThroughputDescription
ProvisionedThroughputDescription'
{ $sel:readCapacityUnits:ProvisionedThroughputDescription' :: Maybe Natural
readCapacityUnits =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:lastDecreaseDateTime:ProvisionedThroughputDescription' :: Maybe POSIX
lastDecreaseDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:writeCapacityUnits:ProvisionedThroughputDescription' :: Maybe Natural
writeCapacityUnits = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:numberOfDecreasesToday:ProvisionedThroughputDescription' :: Maybe Natural
numberOfDecreasesToday = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:lastIncreaseDateTime:ProvisionedThroughputDescription' :: Maybe POSIX
lastIncreaseDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
provisionedThroughputDescription_readCapacityUnits :: Lens.Lens' ProvisionedThroughputDescription (Prelude.Maybe Prelude.Natural)
provisionedThroughputDescription_readCapacityUnits :: (Maybe Natural -> f (Maybe Natural))
-> ProvisionedThroughputDescription
-> f ProvisionedThroughputDescription
provisionedThroughputDescription_readCapacityUnits = (ProvisionedThroughputDescription -> Maybe Natural)
-> (ProvisionedThroughputDescription
-> Maybe Natural -> ProvisionedThroughputDescription)
-> Lens
ProvisionedThroughputDescription
ProvisionedThroughputDescription
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedThroughputDescription' {Maybe Natural
readCapacityUnits :: Maybe Natural
$sel:readCapacityUnits:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe Natural
readCapacityUnits} -> Maybe Natural
readCapacityUnits) (\s :: ProvisionedThroughputDescription
s@ProvisionedThroughputDescription' {} Maybe Natural
a -> ProvisionedThroughputDescription
s {$sel:readCapacityUnits:ProvisionedThroughputDescription' :: Maybe Natural
readCapacityUnits = Maybe Natural
a} :: ProvisionedThroughputDescription)
provisionedThroughputDescription_lastDecreaseDateTime :: Lens.Lens' ProvisionedThroughputDescription (Prelude.Maybe Prelude.UTCTime)
provisionedThroughputDescription_lastDecreaseDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProvisionedThroughputDescription
-> f ProvisionedThroughputDescription
provisionedThroughputDescription_lastDecreaseDateTime = (ProvisionedThroughputDescription -> Maybe POSIX)
-> (ProvisionedThroughputDescription
-> Maybe POSIX -> ProvisionedThroughputDescription)
-> Lens
ProvisionedThroughputDescription
ProvisionedThroughputDescription
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedThroughputDescription' {Maybe POSIX
lastDecreaseDateTime :: Maybe POSIX
$sel:lastDecreaseDateTime:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe POSIX
lastDecreaseDateTime} -> Maybe POSIX
lastDecreaseDateTime) (\s :: ProvisionedThroughputDescription
s@ProvisionedThroughputDescription' {} Maybe POSIX
a -> ProvisionedThroughputDescription
s {$sel:lastDecreaseDateTime:ProvisionedThroughputDescription' :: Maybe POSIX
lastDecreaseDateTime = Maybe POSIX
a} :: ProvisionedThroughputDescription) ((Maybe POSIX -> f (Maybe POSIX))
-> ProvisionedThroughputDescription
-> f ProvisionedThroughputDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProvisionedThroughputDescription
-> f ProvisionedThroughputDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
provisionedThroughputDescription_writeCapacityUnits :: Lens.Lens' ProvisionedThroughputDescription (Prelude.Maybe Prelude.Natural)
provisionedThroughputDescription_writeCapacityUnits :: (Maybe Natural -> f (Maybe Natural))
-> ProvisionedThroughputDescription
-> f ProvisionedThroughputDescription
provisionedThroughputDescription_writeCapacityUnits = (ProvisionedThroughputDescription -> Maybe Natural)
-> (ProvisionedThroughputDescription
-> Maybe Natural -> ProvisionedThroughputDescription)
-> Lens
ProvisionedThroughputDescription
ProvisionedThroughputDescription
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedThroughputDescription' {Maybe Natural
writeCapacityUnits :: Maybe Natural
$sel:writeCapacityUnits:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe Natural
writeCapacityUnits} -> Maybe Natural
writeCapacityUnits) (\s :: ProvisionedThroughputDescription
s@ProvisionedThroughputDescription' {} Maybe Natural
a -> ProvisionedThroughputDescription
s {$sel:writeCapacityUnits:ProvisionedThroughputDescription' :: Maybe Natural
writeCapacityUnits = Maybe Natural
a} :: ProvisionedThroughputDescription)
provisionedThroughputDescription_numberOfDecreasesToday :: Lens.Lens' ProvisionedThroughputDescription (Prelude.Maybe Prelude.Natural)
provisionedThroughputDescription_numberOfDecreasesToday :: (Maybe Natural -> f (Maybe Natural))
-> ProvisionedThroughputDescription
-> f ProvisionedThroughputDescription
provisionedThroughputDescription_numberOfDecreasesToday = (ProvisionedThroughputDescription -> Maybe Natural)
-> (ProvisionedThroughputDescription
-> Maybe Natural -> ProvisionedThroughputDescription)
-> Lens
ProvisionedThroughputDescription
ProvisionedThroughputDescription
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedThroughputDescription' {Maybe Natural
numberOfDecreasesToday :: Maybe Natural
$sel:numberOfDecreasesToday:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe Natural
numberOfDecreasesToday} -> Maybe Natural
numberOfDecreasesToday) (\s :: ProvisionedThroughputDescription
s@ProvisionedThroughputDescription' {} Maybe Natural
a -> ProvisionedThroughputDescription
s {$sel:numberOfDecreasesToday:ProvisionedThroughputDescription' :: Maybe Natural
numberOfDecreasesToday = Maybe Natural
a} :: ProvisionedThroughputDescription)
provisionedThroughputDescription_lastIncreaseDateTime :: Lens.Lens' ProvisionedThroughputDescription (Prelude.Maybe Prelude.UTCTime)
provisionedThroughputDescription_lastIncreaseDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProvisionedThroughputDescription
-> f ProvisionedThroughputDescription
provisionedThroughputDescription_lastIncreaseDateTime = (ProvisionedThroughputDescription -> Maybe POSIX)
-> (ProvisionedThroughputDescription
-> Maybe POSIX -> ProvisionedThroughputDescription)
-> Lens
ProvisionedThroughputDescription
ProvisionedThroughputDescription
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedThroughputDescription' {Maybe POSIX
lastIncreaseDateTime :: Maybe POSIX
$sel:lastIncreaseDateTime:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe POSIX
lastIncreaseDateTime} -> Maybe POSIX
lastIncreaseDateTime) (\s :: ProvisionedThroughputDescription
s@ProvisionedThroughputDescription' {} Maybe POSIX
a -> ProvisionedThroughputDescription
s {$sel:lastIncreaseDateTime:ProvisionedThroughputDescription' :: Maybe POSIX
lastIncreaseDateTime = Maybe POSIX
a} :: ProvisionedThroughputDescription) ((Maybe POSIX -> f (Maybe POSIX))
-> ProvisionedThroughputDescription
-> f ProvisionedThroughputDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProvisionedThroughputDescription
-> f ProvisionedThroughputDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance
Core.FromJSON
ProvisionedThroughputDescription
where
parseJSON :: Value -> Parser ProvisionedThroughputDescription
parseJSON =
String
-> (Object -> Parser ProvisionedThroughputDescription)
-> Value
-> Parser ProvisionedThroughputDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProvisionedThroughputDescription"
( \Object
x ->
Maybe Natural
-> Maybe POSIX
-> Maybe Natural
-> Maybe Natural
-> Maybe POSIX
-> ProvisionedThroughputDescription
ProvisionedThroughputDescription'
(Maybe Natural
-> Maybe POSIX
-> Maybe Natural
-> Maybe Natural
-> Maybe POSIX
-> ProvisionedThroughputDescription)
-> Parser (Maybe Natural)
-> Parser
(Maybe POSIX
-> Maybe Natural
-> Maybe Natural
-> Maybe POSIX
-> ProvisionedThroughputDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReadCapacityUnits")
Parser
(Maybe POSIX
-> Maybe Natural
-> Maybe Natural
-> Maybe POSIX
-> ProvisionedThroughputDescription)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Natural
-> Maybe Natural
-> Maybe POSIX
-> ProvisionedThroughputDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastDecreaseDateTime")
Parser
(Maybe Natural
-> Maybe Natural
-> Maybe POSIX
-> ProvisionedThroughputDescription)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural -> Maybe POSIX -> ProvisionedThroughputDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WriteCapacityUnits")
Parser
(Maybe Natural -> Maybe POSIX -> ProvisionedThroughputDescription)
-> Parser (Maybe Natural)
-> Parser (Maybe POSIX -> ProvisionedThroughputDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumberOfDecreasesToday")
Parser (Maybe POSIX -> ProvisionedThroughputDescription)
-> Parser (Maybe POSIX) -> Parser ProvisionedThroughputDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastIncreaseDateTime")
)
instance
Prelude.Hashable
ProvisionedThroughputDescription
instance
Prelude.NFData
ProvisionedThroughputDescription