{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SES.GetSendQuota
(
GetSendQuota (..),
newGetSendQuota,
GetSendQuotaResponse (..),
newGetSendQuotaResponse,
getSendQuotaResponse_maxSendRate,
getSendQuotaResponse_sentLast24Hours,
getSendQuotaResponse_max24HourSend,
getSendQuotaResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SES.Types
data GetSendQuota = GetSendQuota'
{
}
deriving (GetSendQuota -> GetSendQuota -> Bool
(GetSendQuota -> GetSendQuota -> Bool)
-> (GetSendQuota -> GetSendQuota -> Bool) -> Eq GetSendQuota
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSendQuota -> GetSendQuota -> Bool
$c/= :: GetSendQuota -> GetSendQuota -> Bool
== :: GetSendQuota -> GetSendQuota -> Bool
$c== :: GetSendQuota -> GetSendQuota -> Bool
Prelude.Eq, ReadPrec [GetSendQuota]
ReadPrec GetSendQuota
Int -> ReadS GetSendQuota
ReadS [GetSendQuota]
(Int -> ReadS GetSendQuota)
-> ReadS [GetSendQuota]
-> ReadPrec GetSendQuota
-> ReadPrec [GetSendQuota]
-> Read GetSendQuota
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSendQuota]
$creadListPrec :: ReadPrec [GetSendQuota]
readPrec :: ReadPrec GetSendQuota
$creadPrec :: ReadPrec GetSendQuota
readList :: ReadS [GetSendQuota]
$creadList :: ReadS [GetSendQuota]
readsPrec :: Int -> ReadS GetSendQuota
$creadsPrec :: Int -> ReadS GetSendQuota
Prelude.Read, Int -> GetSendQuota -> ShowS
[GetSendQuota] -> ShowS
GetSendQuota -> String
(Int -> GetSendQuota -> ShowS)
-> (GetSendQuota -> String)
-> ([GetSendQuota] -> ShowS)
-> Show GetSendQuota
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSendQuota] -> ShowS
$cshowList :: [GetSendQuota] -> ShowS
show :: GetSendQuota -> String
$cshow :: GetSendQuota -> String
showsPrec :: Int -> GetSendQuota -> ShowS
$cshowsPrec :: Int -> GetSendQuota -> ShowS
Prelude.Show, (forall x. GetSendQuota -> Rep GetSendQuota x)
-> (forall x. Rep GetSendQuota x -> GetSendQuota)
-> Generic GetSendQuota
forall x. Rep GetSendQuota x -> GetSendQuota
forall x. GetSendQuota -> Rep GetSendQuota x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSendQuota x -> GetSendQuota
$cfrom :: forall x. GetSendQuota -> Rep GetSendQuota x
Prelude.Generic)
newGetSendQuota ::
GetSendQuota
newGetSendQuota :: GetSendQuota
newGetSendQuota = GetSendQuota
GetSendQuota'
instance Core.AWSRequest GetSendQuota where
type AWSResponse GetSendQuota = GetSendQuotaResponse
request :: GetSendQuota -> Request GetSendQuota
request = Service -> GetSendQuota -> Request GetSendQuota
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy GetSendQuota
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSendQuota)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetSendQuota))
-> Logger
-> Service
-> Proxy GetSendQuota
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSendQuota)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"GetSendQuotaResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Double
-> Maybe Double -> Maybe Double -> Int -> GetSendQuotaResponse
GetSendQuotaResponse'
(Maybe Double
-> Maybe Double -> Maybe Double -> Int -> GetSendQuotaResponse)
-> Either String (Maybe Double)
-> Either
String
(Maybe Double -> Maybe Double -> Int -> GetSendQuotaResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MaxSendRate")
Either
String
(Maybe Double -> Maybe Double -> Int -> GetSendQuotaResponse)
-> Either String (Maybe Double)
-> Either String (Maybe Double -> Int -> GetSendQuotaResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SentLast24Hours")
Either String (Maybe Double -> Int -> GetSendQuotaResponse)
-> Either String (Maybe Double)
-> Either String (Int -> GetSendQuotaResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Max24HourSend")
Either String (Int -> GetSendQuotaResponse)
-> Either String Int -> Either String GetSendQuotaResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetSendQuota
instance Prelude.NFData GetSendQuota
instance Core.ToHeaders GetSendQuota where
toHeaders :: GetSendQuota -> ResponseHeaders
toHeaders = ResponseHeaders -> GetSendQuota -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetSendQuota where
toPath :: GetSendQuota -> ByteString
toPath = ByteString -> GetSendQuota -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetSendQuota where
toQuery :: GetSendQuota -> QueryString
toQuery =
QueryString -> GetSendQuota -> QueryString
forall a b. a -> b -> a
Prelude.const
( [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"GetSendQuota" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString)
]
)
data GetSendQuotaResponse = GetSendQuotaResponse'
{
GetSendQuotaResponse -> Maybe Double
maxSendRate :: Prelude.Maybe Prelude.Double,
GetSendQuotaResponse -> Maybe Double
sentLast24Hours :: Prelude.Maybe Prelude.Double,
GetSendQuotaResponse -> Maybe Double
max24HourSend :: Prelude.Maybe Prelude.Double,
GetSendQuotaResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetSendQuotaResponse -> GetSendQuotaResponse -> Bool
(GetSendQuotaResponse -> GetSendQuotaResponse -> Bool)
-> (GetSendQuotaResponse -> GetSendQuotaResponse -> Bool)
-> Eq GetSendQuotaResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSendQuotaResponse -> GetSendQuotaResponse -> Bool
$c/= :: GetSendQuotaResponse -> GetSendQuotaResponse -> Bool
== :: GetSendQuotaResponse -> GetSendQuotaResponse -> Bool
$c== :: GetSendQuotaResponse -> GetSendQuotaResponse -> Bool
Prelude.Eq, ReadPrec [GetSendQuotaResponse]
ReadPrec GetSendQuotaResponse
Int -> ReadS GetSendQuotaResponse
ReadS [GetSendQuotaResponse]
(Int -> ReadS GetSendQuotaResponse)
-> ReadS [GetSendQuotaResponse]
-> ReadPrec GetSendQuotaResponse
-> ReadPrec [GetSendQuotaResponse]
-> Read GetSendQuotaResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSendQuotaResponse]
$creadListPrec :: ReadPrec [GetSendQuotaResponse]
readPrec :: ReadPrec GetSendQuotaResponse
$creadPrec :: ReadPrec GetSendQuotaResponse
readList :: ReadS [GetSendQuotaResponse]
$creadList :: ReadS [GetSendQuotaResponse]
readsPrec :: Int -> ReadS GetSendQuotaResponse
$creadsPrec :: Int -> ReadS GetSendQuotaResponse
Prelude.Read, Int -> GetSendQuotaResponse -> ShowS
[GetSendQuotaResponse] -> ShowS
GetSendQuotaResponse -> String
(Int -> GetSendQuotaResponse -> ShowS)
-> (GetSendQuotaResponse -> String)
-> ([GetSendQuotaResponse] -> ShowS)
-> Show GetSendQuotaResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSendQuotaResponse] -> ShowS
$cshowList :: [GetSendQuotaResponse] -> ShowS
show :: GetSendQuotaResponse -> String
$cshow :: GetSendQuotaResponse -> String
showsPrec :: Int -> GetSendQuotaResponse -> ShowS
$cshowsPrec :: Int -> GetSendQuotaResponse -> ShowS
Prelude.Show, (forall x. GetSendQuotaResponse -> Rep GetSendQuotaResponse x)
-> (forall x. Rep GetSendQuotaResponse x -> GetSendQuotaResponse)
-> Generic GetSendQuotaResponse
forall x. Rep GetSendQuotaResponse x -> GetSendQuotaResponse
forall x. GetSendQuotaResponse -> Rep GetSendQuotaResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSendQuotaResponse x -> GetSendQuotaResponse
$cfrom :: forall x. GetSendQuotaResponse -> Rep GetSendQuotaResponse x
Prelude.Generic)
newGetSendQuotaResponse ::
Prelude.Int ->
GetSendQuotaResponse
newGetSendQuotaResponse :: Int -> GetSendQuotaResponse
newGetSendQuotaResponse Int
pHttpStatus_ =
GetSendQuotaResponse' :: Maybe Double
-> Maybe Double -> Maybe Double -> Int -> GetSendQuotaResponse
GetSendQuotaResponse'
{ $sel:maxSendRate:GetSendQuotaResponse' :: Maybe Double
maxSendRate =
Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:sentLast24Hours:GetSendQuotaResponse' :: Maybe Double
sentLast24Hours = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:max24HourSend:GetSendQuotaResponse' :: Maybe Double
max24HourSend = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetSendQuotaResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getSendQuotaResponse_maxSendRate :: Lens.Lens' GetSendQuotaResponse (Prelude.Maybe Prelude.Double)
getSendQuotaResponse_maxSendRate :: (Maybe Double -> f (Maybe Double))
-> GetSendQuotaResponse -> f GetSendQuotaResponse
getSendQuotaResponse_maxSendRate = (GetSendQuotaResponse -> Maybe Double)
-> (GetSendQuotaResponse -> Maybe Double -> GetSendQuotaResponse)
-> Lens
GetSendQuotaResponse
GetSendQuotaResponse
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSendQuotaResponse' {Maybe Double
maxSendRate :: Maybe Double
$sel:maxSendRate:GetSendQuotaResponse' :: GetSendQuotaResponse -> Maybe Double
maxSendRate} -> Maybe Double
maxSendRate) (\s :: GetSendQuotaResponse
s@GetSendQuotaResponse' {} Maybe Double
a -> GetSendQuotaResponse
s {$sel:maxSendRate:GetSendQuotaResponse' :: Maybe Double
maxSendRate = Maybe Double
a} :: GetSendQuotaResponse)
getSendQuotaResponse_sentLast24Hours :: Lens.Lens' GetSendQuotaResponse (Prelude.Maybe Prelude.Double)
getSendQuotaResponse_sentLast24Hours :: (Maybe Double -> f (Maybe Double))
-> GetSendQuotaResponse -> f GetSendQuotaResponse
getSendQuotaResponse_sentLast24Hours = (GetSendQuotaResponse -> Maybe Double)
-> (GetSendQuotaResponse -> Maybe Double -> GetSendQuotaResponse)
-> Lens
GetSendQuotaResponse
GetSendQuotaResponse
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSendQuotaResponse' {Maybe Double
sentLast24Hours :: Maybe Double
$sel:sentLast24Hours:GetSendQuotaResponse' :: GetSendQuotaResponse -> Maybe Double
sentLast24Hours} -> Maybe Double
sentLast24Hours) (\s :: GetSendQuotaResponse
s@GetSendQuotaResponse' {} Maybe Double
a -> GetSendQuotaResponse
s {$sel:sentLast24Hours:GetSendQuotaResponse' :: Maybe Double
sentLast24Hours = Maybe Double
a} :: GetSendQuotaResponse)
getSendQuotaResponse_max24HourSend :: Lens.Lens' GetSendQuotaResponse (Prelude.Maybe Prelude.Double)
getSendQuotaResponse_max24HourSend :: (Maybe Double -> f (Maybe Double))
-> GetSendQuotaResponse -> f GetSendQuotaResponse
getSendQuotaResponse_max24HourSend = (GetSendQuotaResponse -> Maybe Double)
-> (GetSendQuotaResponse -> Maybe Double -> GetSendQuotaResponse)
-> Lens
GetSendQuotaResponse
GetSendQuotaResponse
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSendQuotaResponse' {Maybe Double
max24HourSend :: Maybe Double
$sel:max24HourSend:GetSendQuotaResponse' :: GetSendQuotaResponse -> Maybe Double
max24HourSend} -> Maybe Double
max24HourSend) (\s :: GetSendQuotaResponse
s@GetSendQuotaResponse' {} Maybe Double
a -> GetSendQuotaResponse
s {$sel:max24HourSend:GetSendQuotaResponse' :: Maybe Double
max24HourSend = Maybe Double
a} :: GetSendQuotaResponse)
getSendQuotaResponse_httpStatus :: Lens.Lens' GetSendQuotaResponse Prelude.Int
getSendQuotaResponse_httpStatus :: (Int -> f Int) -> GetSendQuotaResponse -> f GetSendQuotaResponse
getSendQuotaResponse_httpStatus = (GetSendQuotaResponse -> Int)
-> (GetSendQuotaResponse -> Int -> GetSendQuotaResponse)
-> Lens GetSendQuotaResponse GetSendQuotaResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSendQuotaResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSendQuotaResponse' :: GetSendQuotaResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSendQuotaResponse
s@GetSendQuotaResponse' {} Int
a -> GetSendQuotaResponse
s {$sel:httpStatus:GetSendQuotaResponse' :: Int
httpStatus = Int
a} :: GetSendQuotaResponse)
instance Prelude.NFData GetSendQuotaResponse