{-# 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.ProvisionedThroughputOverride 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 ProvisionedThroughputOverride = ProvisionedThroughputOverride'
{
ProvisionedThroughputOverride -> Maybe Natural
readCapacityUnits :: Prelude.Maybe Prelude.Natural
}
deriving (ProvisionedThroughputOverride
-> ProvisionedThroughputOverride -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisionedThroughputOverride
-> ProvisionedThroughputOverride -> Bool
$c/= :: ProvisionedThroughputOverride
-> ProvisionedThroughputOverride -> Bool
== :: ProvisionedThroughputOverride
-> ProvisionedThroughputOverride -> Bool
$c== :: ProvisionedThroughputOverride
-> ProvisionedThroughputOverride -> Bool
Prelude.Eq, ReadPrec [ProvisionedThroughputOverride]
ReadPrec ProvisionedThroughputOverride
Int -> ReadS ProvisionedThroughputOverride
ReadS [ProvisionedThroughputOverride]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisionedThroughputOverride]
$creadListPrec :: ReadPrec [ProvisionedThroughputOverride]
readPrec :: ReadPrec ProvisionedThroughputOverride
$creadPrec :: ReadPrec ProvisionedThroughputOverride
readList :: ReadS [ProvisionedThroughputOverride]
$creadList :: ReadS [ProvisionedThroughputOverride]
readsPrec :: Int -> ReadS ProvisionedThroughputOverride
$creadsPrec :: Int -> ReadS ProvisionedThroughputOverride
Prelude.Read, Int -> ProvisionedThroughputOverride -> ShowS
[ProvisionedThroughputOverride] -> ShowS
ProvisionedThroughputOverride -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisionedThroughputOverride] -> ShowS
$cshowList :: [ProvisionedThroughputOverride] -> ShowS
show :: ProvisionedThroughputOverride -> String
$cshow :: ProvisionedThroughputOverride -> String
showsPrec :: Int -> ProvisionedThroughputOverride -> ShowS
$cshowsPrec :: Int -> ProvisionedThroughputOverride -> ShowS
Prelude.Show, forall x.
Rep ProvisionedThroughputOverride x
-> ProvisionedThroughputOverride
forall x.
ProvisionedThroughputOverride
-> Rep ProvisionedThroughputOverride x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisionedThroughputOverride x
-> ProvisionedThroughputOverride
$cfrom :: forall x.
ProvisionedThroughputOverride
-> Rep ProvisionedThroughputOverride x
Prelude.Generic)
newProvisionedThroughputOverride ::
ProvisionedThroughputOverride
newProvisionedThroughputOverride :: ProvisionedThroughputOverride
newProvisionedThroughputOverride =
ProvisionedThroughputOverride'
{ $sel:readCapacityUnits:ProvisionedThroughputOverride' :: Maybe Natural
readCapacityUnits =
forall a. Maybe a
Prelude.Nothing
}
provisionedThroughputOverride_readCapacityUnits :: Lens.Lens' ProvisionedThroughputOverride (Prelude.Maybe Prelude.Natural)
provisionedThroughputOverride_readCapacityUnits :: Lens' ProvisionedThroughputOverride (Maybe Natural)
provisionedThroughputOverride_readCapacityUnits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedThroughputOverride' {Maybe Natural
readCapacityUnits :: Maybe Natural
$sel:readCapacityUnits:ProvisionedThroughputOverride' :: ProvisionedThroughputOverride -> Maybe Natural
readCapacityUnits} -> Maybe Natural
readCapacityUnits) (\s :: ProvisionedThroughputOverride
s@ProvisionedThroughputOverride' {} Maybe Natural
a -> ProvisionedThroughputOverride
s {$sel:readCapacityUnits:ProvisionedThroughputOverride' :: Maybe Natural
readCapacityUnits = Maybe Natural
a} :: ProvisionedThroughputOverride)
instance Data.FromJSON ProvisionedThroughputOverride where
parseJSON :: Value -> Parser ProvisionedThroughputOverride
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ProvisionedThroughputOverride"
( \Object
x ->
Maybe Natural -> ProvisionedThroughputOverride
ProvisionedThroughputOverride'
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
"ReadCapacityUnits")
)
instance
Prelude.Hashable
ProvisionedThroughputOverride
where
hashWithSalt :: Int -> ProvisionedThroughputOverride -> Int
hashWithSalt Int
_salt ProvisionedThroughputOverride' {Maybe Natural
readCapacityUnits :: Maybe Natural
$sel:readCapacityUnits:ProvisionedThroughputOverride' :: ProvisionedThroughputOverride -> Maybe Natural
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
readCapacityUnits
instance Prelude.NFData ProvisionedThroughputOverride where
rnf :: ProvisionedThroughputOverride -> ()
rnf ProvisionedThroughputOverride' {Maybe Natural
readCapacityUnits :: Maybe Natural
$sel:readCapacityUnits:ProvisionedThroughputOverride' :: ProvisionedThroughputOverride -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
readCapacityUnits
instance Data.ToJSON ProvisionedThroughputOverride where
toJSON :: ProvisionedThroughputOverride -> Value
toJSON ProvisionedThroughputOverride' {Maybe Natural
readCapacityUnits :: Maybe Natural
$sel:readCapacityUnits:ProvisionedThroughputOverride' :: ProvisionedThroughputOverride -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ReadCapacityUnits" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
readCapacityUnits
]
)