{-# 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.DescribeReceiptRule
(
DescribeReceiptRule (..),
newDescribeReceiptRule,
describeReceiptRule_ruleSetName,
describeReceiptRule_ruleName,
DescribeReceiptRuleResponse (..),
newDescribeReceiptRuleResponse,
describeReceiptRuleResponse_rule,
describeReceiptRuleResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SES.Types
data DescribeReceiptRule = DescribeReceiptRule'
{
DescribeReceiptRule -> Text
ruleSetName :: Prelude.Text,
DescribeReceiptRule -> Text
ruleName :: Prelude.Text
}
deriving (DescribeReceiptRule -> DescribeReceiptRule -> Bool
(DescribeReceiptRule -> DescribeReceiptRule -> Bool)
-> (DescribeReceiptRule -> DescribeReceiptRule -> Bool)
-> Eq DescribeReceiptRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DescribeReceiptRule -> DescribeReceiptRule -> Bool
== :: DescribeReceiptRule -> DescribeReceiptRule -> Bool
$c/= :: DescribeReceiptRule -> DescribeReceiptRule -> Bool
/= :: DescribeReceiptRule -> DescribeReceiptRule -> Bool
Prelude.Eq, ReadPrec [DescribeReceiptRule]
ReadPrec DescribeReceiptRule
Int -> ReadS DescribeReceiptRule
ReadS [DescribeReceiptRule]
(Int -> ReadS DescribeReceiptRule)
-> ReadS [DescribeReceiptRule]
-> ReadPrec DescribeReceiptRule
-> ReadPrec [DescribeReceiptRule]
-> Read DescribeReceiptRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS DescribeReceiptRule
readsPrec :: Int -> ReadS DescribeReceiptRule
$creadList :: ReadS [DescribeReceiptRule]
readList :: ReadS [DescribeReceiptRule]
$creadPrec :: ReadPrec DescribeReceiptRule
readPrec :: ReadPrec DescribeReceiptRule
$creadListPrec :: ReadPrec [DescribeReceiptRule]
readListPrec :: ReadPrec [DescribeReceiptRule]
Prelude.Read, Int -> DescribeReceiptRule -> ShowS
[DescribeReceiptRule] -> ShowS
DescribeReceiptRule -> String
(Int -> DescribeReceiptRule -> ShowS)
-> (DescribeReceiptRule -> String)
-> ([DescribeReceiptRule] -> ShowS)
-> Show DescribeReceiptRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DescribeReceiptRule -> ShowS
showsPrec :: Int -> DescribeReceiptRule -> ShowS
$cshow :: DescribeReceiptRule -> String
show :: DescribeReceiptRule -> String
$cshowList :: [DescribeReceiptRule] -> ShowS
showList :: [DescribeReceiptRule] -> ShowS
Prelude.Show, (forall x. DescribeReceiptRule -> Rep DescribeReceiptRule x)
-> (forall x. Rep DescribeReceiptRule x -> DescribeReceiptRule)
-> Generic DescribeReceiptRule
forall x. Rep DescribeReceiptRule x -> DescribeReceiptRule
forall x. DescribeReceiptRule -> Rep DescribeReceiptRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DescribeReceiptRule -> Rep DescribeReceiptRule x
from :: forall x. DescribeReceiptRule -> Rep DescribeReceiptRule x
$cto :: forall x. Rep DescribeReceiptRule x -> DescribeReceiptRule
to :: forall x. Rep DescribeReceiptRule x -> DescribeReceiptRule
Prelude.Generic)
newDescribeReceiptRule ::
Prelude.Text ->
Prelude.Text ->
DescribeReceiptRule
newDescribeReceiptRule :: Text -> Text -> DescribeReceiptRule
newDescribeReceiptRule Text
pRuleSetName_ Text
pRuleName_ =
DescribeReceiptRule'
{ $sel:ruleSetName:DescribeReceiptRule' :: Text
ruleSetName = Text
pRuleSetName_,
$sel:ruleName:DescribeReceiptRule' :: Text
ruleName = Text
pRuleName_
}
describeReceiptRule_ruleSetName :: Lens.Lens' DescribeReceiptRule Prelude.Text
describeReceiptRule_ruleSetName :: Lens' DescribeReceiptRule Text
describeReceiptRule_ruleSetName = (DescribeReceiptRule -> Text)
-> (DescribeReceiptRule -> Text -> DescribeReceiptRule)
-> Lens' DescribeReceiptRule Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRule' {Text
$sel:ruleSetName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
ruleSetName :: Text
ruleSetName} -> Text
ruleSetName) (\s :: DescribeReceiptRule
s@DescribeReceiptRule' {} Text
a -> DescribeReceiptRule
s {ruleSetName = a} :: DescribeReceiptRule)
describeReceiptRule_ruleName :: Lens.Lens' DescribeReceiptRule Prelude.Text
describeReceiptRule_ruleName :: Lens' DescribeReceiptRule Text
describeReceiptRule_ruleName = (DescribeReceiptRule -> Text)
-> (DescribeReceiptRule -> Text -> DescribeReceiptRule)
-> Lens' DescribeReceiptRule Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRule' {Text
$sel:ruleName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
ruleName :: Text
ruleName} -> Text
ruleName) (\s :: DescribeReceiptRule
s@DescribeReceiptRule' {} Text
a -> DescribeReceiptRule
s {ruleName = a} :: DescribeReceiptRule)
instance Core.AWSRequest DescribeReceiptRule where
type
AWSResponse DescribeReceiptRule =
DescribeReceiptRuleResponse
request :: (Service -> Service)
-> DescribeReceiptRule -> Request DescribeReceiptRule
request Service -> Service
overrides =
Service -> DescribeReceiptRule -> Request DescribeReceiptRule
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeReceiptRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeReceiptRule)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribeReceiptRule))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeReceiptRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeReceiptRule)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DescribeReceiptRuleResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe ReceiptRule -> Int -> DescribeReceiptRuleResponse
DescribeReceiptRuleResponse'
(Maybe ReceiptRule -> Int -> DescribeReceiptRuleResponse)
-> Either String (Maybe ReceiptRule)
-> Either String (Int -> DescribeReceiptRuleResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ReceiptRule)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Rule")
Either String (Int -> DescribeReceiptRuleResponse)
-> Either String Int -> Either String DescribeReceiptRuleResponse
forall a b.
Either String (a -> b) -> Either String a -> Either String b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall a. a -> Either String a
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 DescribeReceiptRule where
hashWithSalt :: Int -> DescribeReceiptRule -> Int
hashWithSalt Int
_salt DescribeReceiptRule' {Text
$sel:ruleSetName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
$sel:ruleName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
ruleSetName :: Text
ruleName :: Text
..} =
Int
_salt
Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleSetName
Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleName
instance Prelude.NFData DescribeReceiptRule where
rnf :: DescribeReceiptRule -> ()
rnf DescribeReceiptRule' {Text
$sel:ruleSetName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
$sel:ruleName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
ruleSetName :: Text
ruleName :: Text
..} =
Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleSetName
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleName
instance Data.ToHeaders DescribeReceiptRule where
toHeaders :: DescribeReceiptRule -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeReceiptRule -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DescribeReceiptRule where
toPath :: DescribeReceiptRule -> ByteString
toPath = ByteString -> DescribeReceiptRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeReceiptRule where
toQuery :: DescribeReceiptRule -> QueryString
toQuery DescribeReceiptRule' {Text
$sel:ruleSetName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
$sel:ruleName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
ruleSetName :: Text
ruleName :: Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeReceiptRule" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"RuleSetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
ruleSetName,
ByteString
"RuleName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
ruleName
]
data DescribeReceiptRuleResponse = DescribeReceiptRuleResponse'
{
DescribeReceiptRuleResponse -> Maybe ReceiptRule
rule :: Prelude.Maybe ReceiptRule,
DescribeReceiptRuleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeReceiptRuleResponse -> DescribeReceiptRuleResponse -> Bool
(DescribeReceiptRuleResponse
-> DescribeReceiptRuleResponse -> Bool)
-> (DescribeReceiptRuleResponse
-> DescribeReceiptRuleResponse -> Bool)
-> Eq DescribeReceiptRuleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DescribeReceiptRuleResponse -> DescribeReceiptRuleResponse -> Bool
== :: DescribeReceiptRuleResponse -> DescribeReceiptRuleResponse -> Bool
$c/= :: DescribeReceiptRuleResponse -> DescribeReceiptRuleResponse -> Bool
/= :: DescribeReceiptRuleResponse -> DescribeReceiptRuleResponse -> Bool
Prelude.Eq, ReadPrec [DescribeReceiptRuleResponse]
ReadPrec DescribeReceiptRuleResponse
Int -> ReadS DescribeReceiptRuleResponse
ReadS [DescribeReceiptRuleResponse]
(Int -> ReadS DescribeReceiptRuleResponse)
-> ReadS [DescribeReceiptRuleResponse]
-> ReadPrec DescribeReceiptRuleResponse
-> ReadPrec [DescribeReceiptRuleResponse]
-> Read DescribeReceiptRuleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS DescribeReceiptRuleResponse
readsPrec :: Int -> ReadS DescribeReceiptRuleResponse
$creadList :: ReadS [DescribeReceiptRuleResponse]
readList :: ReadS [DescribeReceiptRuleResponse]
$creadPrec :: ReadPrec DescribeReceiptRuleResponse
readPrec :: ReadPrec DescribeReceiptRuleResponse
$creadListPrec :: ReadPrec [DescribeReceiptRuleResponse]
readListPrec :: ReadPrec [DescribeReceiptRuleResponse]
Prelude.Read, Int -> DescribeReceiptRuleResponse -> ShowS
[DescribeReceiptRuleResponse] -> ShowS
DescribeReceiptRuleResponse -> String
(Int -> DescribeReceiptRuleResponse -> ShowS)
-> (DescribeReceiptRuleResponse -> String)
-> ([DescribeReceiptRuleResponse] -> ShowS)
-> Show DescribeReceiptRuleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DescribeReceiptRuleResponse -> ShowS
showsPrec :: Int -> DescribeReceiptRuleResponse -> ShowS
$cshow :: DescribeReceiptRuleResponse -> String
show :: DescribeReceiptRuleResponse -> String
$cshowList :: [DescribeReceiptRuleResponse] -> ShowS
showList :: [DescribeReceiptRuleResponse] -> ShowS
Prelude.Show, (forall x.
DescribeReceiptRuleResponse -> Rep DescribeReceiptRuleResponse x)
-> (forall x.
Rep DescribeReceiptRuleResponse x -> DescribeReceiptRuleResponse)
-> Generic DescribeReceiptRuleResponse
forall x.
Rep DescribeReceiptRuleResponse x -> DescribeReceiptRuleResponse
forall x.
DescribeReceiptRuleResponse -> Rep DescribeReceiptRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
DescribeReceiptRuleResponse -> Rep DescribeReceiptRuleResponse x
from :: forall x.
DescribeReceiptRuleResponse -> Rep DescribeReceiptRuleResponse x
$cto :: forall x.
Rep DescribeReceiptRuleResponse x -> DescribeReceiptRuleResponse
to :: forall x.
Rep DescribeReceiptRuleResponse x -> DescribeReceiptRuleResponse
Prelude.Generic)
newDescribeReceiptRuleResponse ::
Prelude.Int ->
DescribeReceiptRuleResponse
newDescribeReceiptRuleResponse :: Int -> DescribeReceiptRuleResponse
newDescribeReceiptRuleResponse Int
pHttpStatus_ =
DescribeReceiptRuleResponse'
{ $sel:rule:DescribeReceiptRuleResponse' :: Maybe ReceiptRule
rule =
Maybe ReceiptRule
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeReceiptRuleResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeReceiptRuleResponse_rule :: Lens.Lens' DescribeReceiptRuleResponse (Prelude.Maybe ReceiptRule)
describeReceiptRuleResponse_rule :: Lens' DescribeReceiptRuleResponse (Maybe ReceiptRule)
describeReceiptRuleResponse_rule = (DescribeReceiptRuleResponse -> Maybe ReceiptRule)
-> (DescribeReceiptRuleResponse
-> Maybe ReceiptRule -> DescribeReceiptRuleResponse)
-> Lens' DescribeReceiptRuleResponse (Maybe ReceiptRule)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRuleResponse' {Maybe ReceiptRule
$sel:rule:DescribeReceiptRuleResponse' :: DescribeReceiptRuleResponse -> Maybe ReceiptRule
rule :: Maybe ReceiptRule
rule} -> Maybe ReceiptRule
rule) (\s :: DescribeReceiptRuleResponse
s@DescribeReceiptRuleResponse' {} Maybe ReceiptRule
a -> DescribeReceiptRuleResponse
s {rule = a} :: DescribeReceiptRuleResponse)
describeReceiptRuleResponse_httpStatus :: Lens.Lens' DescribeReceiptRuleResponse Prelude.Int
describeReceiptRuleResponse_httpStatus :: Lens' DescribeReceiptRuleResponse Int
describeReceiptRuleResponse_httpStatus = (DescribeReceiptRuleResponse -> Int)
-> (DescribeReceiptRuleResponse
-> Int -> DescribeReceiptRuleResponse)
-> Lens' DescribeReceiptRuleResponse Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRuleResponse' {Int
$sel:httpStatus:DescribeReceiptRuleResponse' :: DescribeReceiptRuleResponse -> Int
httpStatus :: Int
httpStatus} -> Int
httpStatus) (\s :: DescribeReceiptRuleResponse
s@DescribeReceiptRuleResponse' {} Int
a -> DescribeReceiptRuleResponse
s {httpStatus = a} :: DescribeReceiptRuleResponse)
instance Prelude.NFData DescribeReceiptRuleResponse where
rnf :: DescribeReceiptRuleResponse -> ()
rnf DescribeReceiptRuleResponse' {Int
Maybe ReceiptRule
$sel:rule:DescribeReceiptRuleResponse' :: DescribeReceiptRuleResponse -> Maybe ReceiptRule
$sel:httpStatus:DescribeReceiptRuleResponse' :: DescribeReceiptRuleResponse -> Int
rule :: Maybe ReceiptRule
httpStatus :: Int
..} =
Maybe ReceiptRule -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe ReceiptRule
rule
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Int -> ()
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus