{-# 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
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReceiptRule -> DescribeReceiptRule -> Bool
$c/= :: DescribeReceiptRule -> DescribeReceiptRule -> Bool
== :: DescribeReceiptRule -> DescribeReceiptRule -> Bool
$c== :: DescribeReceiptRule -> DescribeReceiptRule -> Bool
Prelude.Eq, ReadPrec [DescribeReceiptRule]
ReadPrec DescribeReceiptRule
Int -> ReadS DescribeReceiptRule
ReadS [DescribeReceiptRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReceiptRule]
$creadListPrec :: ReadPrec [DescribeReceiptRule]
readPrec :: ReadPrec DescribeReceiptRule
$creadPrec :: ReadPrec DescribeReceiptRule
readList :: ReadS [DescribeReceiptRule]
$creadList :: ReadS [DescribeReceiptRule]
readsPrec :: Int -> ReadS DescribeReceiptRule
$creadsPrec :: Int -> ReadS DescribeReceiptRule
Prelude.Read, Int -> DescribeReceiptRule -> ShowS
[DescribeReceiptRule] -> ShowS
DescribeReceiptRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReceiptRule] -> ShowS
$cshowList :: [DescribeReceiptRule] -> ShowS
show :: DescribeReceiptRule -> String
$cshow :: DescribeReceiptRule -> String
showsPrec :: Int -> DescribeReceiptRule -> ShowS
$cshowsPrec :: Int -> DescribeReceiptRule -> ShowS
Prelude.Show, 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
$cto :: forall x. Rep DescribeReceiptRule x -> DescribeReceiptRule
$cfrom :: forall x. DescribeReceiptRule -> Rep DescribeReceiptRule x
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 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRule' {Text
ruleSetName :: Text
$sel:ruleSetName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
ruleSetName} -> Text
ruleSetName) (\s :: DescribeReceiptRule
s@DescribeReceiptRule' {} Text
a -> DescribeReceiptRule
s {$sel:ruleSetName:DescribeReceiptRule' :: Text
ruleSetName = Text
a} :: DescribeReceiptRule)
describeReceiptRule_ruleName :: Lens.Lens' DescribeReceiptRule Prelude.Text
describeReceiptRule_ruleName :: Lens' DescribeReceiptRule Text
describeReceiptRule_ruleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRule' {Text
ruleName :: Text
$sel:ruleName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
ruleName} -> Text
ruleName) (\s :: DescribeReceiptRule
s@DescribeReceiptRule' {} Text
a -> DescribeReceiptRule
s {$sel:ruleName:DescribeReceiptRule' :: Text
ruleName = Text
a} :: DescribeReceiptRule)
instance Core.AWSRequest DescribeReceiptRule where
type
AWSResponse DescribeReceiptRule =
DescribeReceiptRuleResponse
request :: (Service -> Service)
-> DescribeReceiptRule -> Request DescribeReceiptRule
request Service -> Service
overrides =
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 =
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'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Rule")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeReceiptRule where
hashWithSalt :: Int -> DescribeReceiptRule -> Int
hashWithSalt Int
_salt DescribeReceiptRule' {Text
ruleName :: Text
ruleSetName :: Text
$sel:ruleName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
$sel:ruleSetName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleSetName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleName
instance Prelude.NFData DescribeReceiptRule where
rnf :: DescribeReceiptRule -> ()
rnf DescribeReceiptRule' {Text
ruleName :: Text
ruleSetName :: Text
$sel:ruleName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
$sel:ruleSetName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleSetName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ruleName
instance Data.ToHeaders DescribeReceiptRule where
toHeaders :: DescribeReceiptRule -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DescribeReceiptRule where
toPath :: DescribeReceiptRule -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeReceiptRule where
toQuery :: DescribeReceiptRule -> QueryString
toQuery DescribeReceiptRule' {Text
ruleName :: Text
ruleSetName :: Text
$sel:ruleName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
$sel:ruleSetName:DescribeReceiptRule' :: DescribeReceiptRule -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeReceiptRule" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"RuleSetName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
ruleSetName,
ByteString
"RuleName" 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
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReceiptRuleResponse -> DescribeReceiptRuleResponse -> Bool
$c/= :: DescribeReceiptRuleResponse -> DescribeReceiptRuleResponse -> Bool
== :: DescribeReceiptRuleResponse -> DescribeReceiptRuleResponse -> Bool
$c== :: DescribeReceiptRuleResponse -> DescribeReceiptRuleResponse -> Bool
Prelude.Eq, ReadPrec [DescribeReceiptRuleResponse]
ReadPrec DescribeReceiptRuleResponse
Int -> ReadS DescribeReceiptRuleResponse
ReadS [DescribeReceiptRuleResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReceiptRuleResponse]
$creadListPrec :: ReadPrec [DescribeReceiptRuleResponse]
readPrec :: ReadPrec DescribeReceiptRuleResponse
$creadPrec :: ReadPrec DescribeReceiptRuleResponse
readList :: ReadS [DescribeReceiptRuleResponse]
$creadList :: ReadS [DescribeReceiptRuleResponse]
readsPrec :: Int -> ReadS DescribeReceiptRuleResponse
$creadsPrec :: Int -> ReadS DescribeReceiptRuleResponse
Prelude.Read, Int -> DescribeReceiptRuleResponse -> ShowS
[DescribeReceiptRuleResponse] -> ShowS
DescribeReceiptRuleResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReceiptRuleResponse] -> ShowS
$cshowList :: [DescribeReceiptRuleResponse] -> ShowS
show :: DescribeReceiptRuleResponse -> String
$cshow :: DescribeReceiptRuleResponse -> String
showsPrec :: Int -> DescribeReceiptRuleResponse -> ShowS
$cshowsPrec :: Int -> DescribeReceiptRuleResponse -> ShowS
Prelude.Show, 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
$cto :: forall x.
Rep DescribeReceiptRuleResponse x -> DescribeReceiptRuleResponse
$cfrom :: forall x.
DescribeReceiptRuleResponse -> Rep DescribeReceiptRuleResponse x
Prelude.Generic)
newDescribeReceiptRuleResponse ::
Prelude.Int ->
DescribeReceiptRuleResponse
newDescribeReceiptRuleResponse :: Int -> DescribeReceiptRuleResponse
newDescribeReceiptRuleResponse Int
pHttpStatus_ =
DescribeReceiptRuleResponse'
{ $sel:rule:DescribeReceiptRuleResponse' :: Maybe ReceiptRule
rule =
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 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRuleResponse' {Maybe ReceiptRule
rule :: Maybe ReceiptRule
$sel:rule:DescribeReceiptRuleResponse' :: DescribeReceiptRuleResponse -> Maybe ReceiptRule
rule} -> Maybe ReceiptRule
rule) (\s :: DescribeReceiptRuleResponse
s@DescribeReceiptRuleResponse' {} Maybe ReceiptRule
a -> DescribeReceiptRuleResponse
s {$sel:rule:DescribeReceiptRuleResponse' :: Maybe ReceiptRule
rule = Maybe ReceiptRule
a} :: DescribeReceiptRuleResponse)
describeReceiptRuleResponse_httpStatus :: Lens.Lens' DescribeReceiptRuleResponse Prelude.Int
describeReceiptRuleResponse_httpStatus :: Lens' DescribeReceiptRuleResponse Int
describeReceiptRuleResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeReceiptRuleResponse' :: DescribeReceiptRuleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeReceiptRuleResponse
s@DescribeReceiptRuleResponse' {} Int
a -> DescribeReceiptRuleResponse
s {$sel:httpStatus:DescribeReceiptRuleResponse' :: Int
httpStatus = Int
a} :: DescribeReceiptRuleResponse)
instance Prelude.NFData DescribeReceiptRuleResponse where
rnf :: DescribeReceiptRuleResponse -> ()
rnf DescribeReceiptRuleResponse' {Int
Maybe ReceiptRule
httpStatus :: Int
rule :: Maybe ReceiptRule
$sel:httpStatus:DescribeReceiptRuleResponse' :: DescribeReceiptRuleResponse -> Int
$sel:rule:DescribeReceiptRuleResponse' :: DescribeReceiptRuleResponse -> Maybe ReceiptRule
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ReceiptRule
rule
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus