{-# 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.PinpointEmail.Types.SendQuota where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SendQuota = SendQuota'
{
SendQuota -> Maybe Double
maxSendRate :: Prelude.Maybe Prelude.Double,
SendQuota -> Maybe Double
sentLast24Hours :: Prelude.Maybe Prelude.Double,
SendQuota -> Maybe Double
max24HourSend :: Prelude.Maybe Prelude.Double
}
deriving (SendQuota -> SendQuota -> Bool
(SendQuota -> SendQuota -> Bool)
-> (SendQuota -> SendQuota -> Bool) -> Eq SendQuota
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendQuota -> SendQuota -> Bool
$c/= :: SendQuota -> SendQuota -> Bool
== :: SendQuota -> SendQuota -> Bool
$c== :: SendQuota -> SendQuota -> Bool
Prelude.Eq, ReadPrec [SendQuota]
ReadPrec SendQuota
Int -> ReadS SendQuota
ReadS [SendQuota]
(Int -> ReadS SendQuota)
-> ReadS [SendQuota]
-> ReadPrec SendQuota
-> ReadPrec [SendQuota]
-> Read SendQuota
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendQuota]
$creadListPrec :: ReadPrec [SendQuota]
readPrec :: ReadPrec SendQuota
$creadPrec :: ReadPrec SendQuota
readList :: ReadS [SendQuota]
$creadList :: ReadS [SendQuota]
readsPrec :: Int -> ReadS SendQuota
$creadsPrec :: Int -> ReadS SendQuota
Prelude.Read, Int -> SendQuota -> ShowS
[SendQuota] -> ShowS
SendQuota -> String
(Int -> SendQuota -> ShowS)
-> (SendQuota -> String)
-> ([SendQuota] -> ShowS)
-> Show SendQuota
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendQuota] -> ShowS
$cshowList :: [SendQuota] -> ShowS
show :: SendQuota -> String
$cshow :: SendQuota -> String
showsPrec :: Int -> SendQuota -> ShowS
$cshowsPrec :: Int -> SendQuota -> ShowS
Prelude.Show, (forall x. SendQuota -> Rep SendQuota x)
-> (forall x. Rep SendQuota x -> SendQuota) -> Generic SendQuota
forall x. Rep SendQuota x -> SendQuota
forall x. SendQuota -> Rep SendQuota x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendQuota x -> SendQuota
$cfrom :: forall x. SendQuota -> Rep SendQuota x
Prelude.Generic)
newSendQuota ::
SendQuota
newSendQuota :: SendQuota
newSendQuota =
SendQuota' :: Maybe Double -> Maybe Double -> Maybe Double -> SendQuota
SendQuota'
{ $sel:maxSendRate:SendQuota' :: Maybe Double
maxSendRate = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:sentLast24Hours:SendQuota' :: Maybe Double
sentLast24Hours = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:max24HourSend:SendQuota' :: Maybe Double
max24HourSend = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
sendQuota_maxSendRate :: Lens.Lens' SendQuota (Prelude.Maybe Prelude.Double)
sendQuota_maxSendRate :: (Maybe Double -> f (Maybe Double)) -> SendQuota -> f SendQuota
sendQuota_maxSendRate = (SendQuota -> Maybe Double)
-> (SendQuota -> Maybe Double -> SendQuota)
-> Lens SendQuota SendQuota (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendQuota' {Maybe Double
maxSendRate :: Maybe Double
$sel:maxSendRate:SendQuota' :: SendQuota -> Maybe Double
maxSendRate} -> Maybe Double
maxSendRate) (\s :: SendQuota
s@SendQuota' {} Maybe Double
a -> SendQuota
s {$sel:maxSendRate:SendQuota' :: Maybe Double
maxSendRate = Maybe Double
a} :: SendQuota)
sendQuota_sentLast24Hours :: Lens.Lens' SendQuota (Prelude.Maybe Prelude.Double)
sendQuota_sentLast24Hours :: (Maybe Double -> f (Maybe Double)) -> SendQuota -> f SendQuota
sendQuota_sentLast24Hours = (SendQuota -> Maybe Double)
-> (SendQuota -> Maybe Double -> SendQuota)
-> Lens SendQuota SendQuota (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendQuota' {Maybe Double
sentLast24Hours :: Maybe Double
$sel:sentLast24Hours:SendQuota' :: SendQuota -> Maybe Double
sentLast24Hours} -> Maybe Double
sentLast24Hours) (\s :: SendQuota
s@SendQuota' {} Maybe Double
a -> SendQuota
s {$sel:sentLast24Hours:SendQuota' :: Maybe Double
sentLast24Hours = Maybe Double
a} :: SendQuota)
sendQuota_max24HourSend :: Lens.Lens' SendQuota (Prelude.Maybe Prelude.Double)
sendQuota_max24HourSend :: (Maybe Double -> f (Maybe Double)) -> SendQuota -> f SendQuota
sendQuota_max24HourSend = (SendQuota -> Maybe Double)
-> (SendQuota -> Maybe Double -> SendQuota)
-> Lens SendQuota SendQuota (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendQuota' {Maybe Double
max24HourSend :: Maybe Double
$sel:max24HourSend:SendQuota' :: SendQuota -> Maybe Double
max24HourSend} -> Maybe Double
max24HourSend) (\s :: SendQuota
s@SendQuota' {} Maybe Double
a -> SendQuota
s {$sel:max24HourSend:SendQuota' :: Maybe Double
max24HourSend = Maybe Double
a} :: SendQuota)
instance Core.FromJSON SendQuota where
parseJSON :: Value -> Parser SendQuota
parseJSON =
String -> (Object -> Parser SendQuota) -> Value -> Parser SendQuota
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SendQuota"
( \Object
x ->
Maybe Double -> Maybe Double -> Maybe Double -> SendQuota
SendQuota'
(Maybe Double -> Maybe Double -> Maybe Double -> SendQuota)
-> Parser (Maybe Double)
-> Parser (Maybe Double -> Maybe Double -> SendQuota)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxSendRate")
Parser (Maybe Double -> Maybe Double -> SendQuota)
-> Parser (Maybe Double) -> Parser (Maybe Double -> SendQuota)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SentLast24Hours")
Parser (Maybe Double -> SendQuota)
-> Parser (Maybe Double) -> Parser SendQuota
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Max24HourSend")
)
instance Prelude.Hashable SendQuota
instance Prelude.NFData SendQuota