{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DynamoDB.Types.AttributeValue
import Amazonka.DynamoDB.Types.WriteRequest
import qualified Amazonka.Prelude as Prelude
data ProvisionedThroughputDescription = ProvisionedThroughputDescription'
{
ProvisionedThroughputDescription -> Maybe POSIX
lastDecreaseDateTime :: Prelude.Maybe Data.POSIX,
ProvisionedThroughputDescription -> Maybe POSIX
lastIncreaseDateTime :: Prelude.Maybe Data.POSIX,
ProvisionedThroughputDescription -> Maybe Natural
numberOfDecreasesToday :: Prelude.Maybe Prelude.Natural,
ProvisionedThroughputDescription -> Maybe Natural
readCapacityUnits :: Prelude.Maybe Prelude.Natural,
ProvisionedThroughputDescription -> Maybe Natural
writeCapacityUnits :: Prelude.Maybe Prelude.Natural
}
deriving (ProvisionedThroughputDescription
-> ProvisionedThroughputDescription -> Bool
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]
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
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.
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'
{ $sel:lastDecreaseDateTime:ProvisionedThroughputDescription' :: Maybe POSIX
lastDecreaseDateTime =
forall a. Maybe a
Prelude.Nothing,
$sel:lastIncreaseDateTime:ProvisionedThroughputDescription' :: Maybe POSIX
lastIncreaseDateTime = forall a. Maybe a
Prelude.Nothing,
$sel:numberOfDecreasesToday:ProvisionedThroughputDescription' :: Maybe Natural
numberOfDecreasesToday = forall a. Maybe a
Prelude.Nothing,
$sel:readCapacityUnits:ProvisionedThroughputDescription' :: Maybe Natural
readCapacityUnits = forall a. Maybe a
Prelude.Nothing,
$sel:writeCapacityUnits:ProvisionedThroughputDescription' :: Maybe Natural
writeCapacityUnits = forall a. Maybe a
Prelude.Nothing
}
provisionedThroughputDescription_lastDecreaseDateTime :: Lens.Lens' ProvisionedThroughputDescription (Prelude.Maybe Prelude.UTCTime)
provisionedThroughputDescription_lastDecreaseDateTime :: Lens' ProvisionedThroughputDescription (Maybe UTCTime)
provisionedThroughputDescription_lastDecreaseDateTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
provisionedThroughputDescription_lastIncreaseDateTime :: Lens.Lens' ProvisionedThroughputDescription (Prelude.Maybe Prelude.UTCTime)
provisionedThroughputDescription_lastIncreaseDateTime :: Lens' ProvisionedThroughputDescription (Maybe UTCTime)
provisionedThroughputDescription_lastIncreaseDateTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
provisionedThroughputDescription_numberOfDecreasesToday :: Lens.Lens' ProvisionedThroughputDescription (Prelude.Maybe Prelude.Natural)
provisionedThroughputDescription_numberOfDecreasesToday :: Lens' ProvisionedThroughputDescription (Maybe Natural)
provisionedThroughputDescription_numberOfDecreasesToday = 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_readCapacityUnits :: Lens.Lens' ProvisionedThroughputDescription (Prelude.Maybe Prelude.Natural)
provisionedThroughputDescription_readCapacityUnits :: Lens' ProvisionedThroughputDescription (Maybe Natural)
provisionedThroughputDescription_readCapacityUnits = 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_writeCapacityUnits :: Lens.Lens' ProvisionedThroughputDescription (Prelude.Maybe Prelude.Natural)
provisionedThroughputDescription_writeCapacityUnits :: Lens' ProvisionedThroughputDescription (Maybe Natural)
provisionedThroughputDescription_writeCapacityUnits = 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)
instance
Data.FromJSON
ProvisionedThroughputDescription
where
parseJSON :: Value -> Parser ProvisionedThroughputDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ProvisionedThroughputDescription"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> ProvisionedThroughputDescription
ProvisionedThroughputDescription'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastDecreaseDateTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastIncreaseDateTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NumberOfDecreasesToday")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ReadCapacityUnits")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"WriteCapacityUnits")
)
instance
Prelude.Hashable
ProvisionedThroughputDescription
where
hashWithSalt :: Int -> ProvisionedThroughputDescription -> Int
hashWithSalt
Int
_salt
ProvisionedThroughputDescription' {Maybe Natural
Maybe POSIX
writeCapacityUnits :: Maybe Natural
readCapacityUnits :: Maybe Natural
numberOfDecreasesToday :: Maybe Natural
lastIncreaseDateTime :: Maybe POSIX
lastDecreaseDateTime :: Maybe POSIX
$sel:writeCapacityUnits:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe Natural
$sel:readCapacityUnits:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe Natural
$sel:numberOfDecreasesToday:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe Natural
$sel:lastIncreaseDateTime:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe POSIX
$sel:lastDecreaseDateTime:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastDecreaseDateTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastIncreaseDateTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
numberOfDecreasesToday
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
readCapacityUnits
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
writeCapacityUnits
instance
Prelude.NFData
ProvisionedThroughputDescription
where
rnf :: ProvisionedThroughputDescription -> ()
rnf ProvisionedThroughputDescription' {Maybe Natural
Maybe POSIX
writeCapacityUnits :: Maybe Natural
readCapacityUnits :: Maybe Natural
numberOfDecreasesToday :: Maybe Natural
lastIncreaseDateTime :: Maybe POSIX
lastDecreaseDateTime :: Maybe POSIX
$sel:writeCapacityUnits:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe Natural
$sel:readCapacityUnits:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe Natural
$sel:numberOfDecreasesToday:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe Natural
$sel:lastIncreaseDateTime:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe POSIX
$sel:lastDecreaseDateTime:ProvisionedThroughputDescription' :: ProvisionedThroughputDescription -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastDecreaseDateTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastIncreaseDateTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
numberOfDecreasesToday
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
readCapacityUnits
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
writeCapacityUnits