{-# 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.DescribeReceiptRuleSet
(
DescribeReceiptRuleSet (..),
newDescribeReceiptRuleSet,
describeReceiptRuleSet_ruleSetName,
DescribeReceiptRuleSetResponse (..),
newDescribeReceiptRuleSetResponse,
describeReceiptRuleSetResponse_rules,
describeReceiptRuleSetResponse_metadata,
describeReceiptRuleSetResponse_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 DescribeReceiptRuleSet = DescribeReceiptRuleSet'
{
DescribeReceiptRuleSet -> Text
ruleSetName :: Prelude.Text
}
deriving (DescribeReceiptRuleSet -> DescribeReceiptRuleSet -> Bool
(DescribeReceiptRuleSet -> DescribeReceiptRuleSet -> Bool)
-> (DescribeReceiptRuleSet -> DescribeReceiptRuleSet -> Bool)
-> Eq DescribeReceiptRuleSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReceiptRuleSet -> DescribeReceiptRuleSet -> Bool
$c/= :: DescribeReceiptRuleSet -> DescribeReceiptRuleSet -> Bool
== :: DescribeReceiptRuleSet -> DescribeReceiptRuleSet -> Bool
$c== :: DescribeReceiptRuleSet -> DescribeReceiptRuleSet -> Bool
Prelude.Eq, ReadPrec [DescribeReceiptRuleSet]
ReadPrec DescribeReceiptRuleSet
Int -> ReadS DescribeReceiptRuleSet
ReadS [DescribeReceiptRuleSet]
(Int -> ReadS DescribeReceiptRuleSet)
-> ReadS [DescribeReceiptRuleSet]
-> ReadPrec DescribeReceiptRuleSet
-> ReadPrec [DescribeReceiptRuleSet]
-> Read DescribeReceiptRuleSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReceiptRuleSet]
$creadListPrec :: ReadPrec [DescribeReceiptRuleSet]
readPrec :: ReadPrec DescribeReceiptRuleSet
$creadPrec :: ReadPrec DescribeReceiptRuleSet
readList :: ReadS [DescribeReceiptRuleSet]
$creadList :: ReadS [DescribeReceiptRuleSet]
readsPrec :: Int -> ReadS DescribeReceiptRuleSet
$creadsPrec :: Int -> ReadS DescribeReceiptRuleSet
Prelude.Read, Int -> DescribeReceiptRuleSet -> ShowS
[DescribeReceiptRuleSet] -> ShowS
DescribeReceiptRuleSet -> String
(Int -> DescribeReceiptRuleSet -> ShowS)
-> (DescribeReceiptRuleSet -> String)
-> ([DescribeReceiptRuleSet] -> ShowS)
-> Show DescribeReceiptRuleSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReceiptRuleSet] -> ShowS
$cshowList :: [DescribeReceiptRuleSet] -> ShowS
show :: DescribeReceiptRuleSet -> String
$cshow :: DescribeReceiptRuleSet -> String
showsPrec :: Int -> DescribeReceiptRuleSet -> ShowS
$cshowsPrec :: Int -> DescribeReceiptRuleSet -> ShowS
Prelude.Show, (forall x. DescribeReceiptRuleSet -> Rep DescribeReceiptRuleSet x)
-> (forall x.
Rep DescribeReceiptRuleSet x -> DescribeReceiptRuleSet)
-> Generic DescribeReceiptRuleSet
forall x. Rep DescribeReceiptRuleSet x -> DescribeReceiptRuleSet
forall x. DescribeReceiptRuleSet -> Rep DescribeReceiptRuleSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeReceiptRuleSet x -> DescribeReceiptRuleSet
$cfrom :: forall x. DescribeReceiptRuleSet -> Rep DescribeReceiptRuleSet x
Prelude.Generic)
newDescribeReceiptRuleSet ::
Prelude.Text ->
DescribeReceiptRuleSet
newDescribeReceiptRuleSet :: Text -> DescribeReceiptRuleSet
newDescribeReceiptRuleSet Text
pRuleSetName_ =
DescribeReceiptRuleSet' :: Text -> DescribeReceiptRuleSet
DescribeReceiptRuleSet'
{ $sel:ruleSetName:DescribeReceiptRuleSet' :: Text
ruleSetName =
Text
pRuleSetName_
}
describeReceiptRuleSet_ruleSetName :: Lens.Lens' DescribeReceiptRuleSet Prelude.Text
describeReceiptRuleSet_ruleSetName :: (Text -> f Text)
-> DescribeReceiptRuleSet -> f DescribeReceiptRuleSet
describeReceiptRuleSet_ruleSetName = (DescribeReceiptRuleSet -> Text)
-> (DescribeReceiptRuleSet -> Text -> DescribeReceiptRuleSet)
-> Lens DescribeReceiptRuleSet DescribeReceiptRuleSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRuleSet' {Text
ruleSetName :: Text
$sel:ruleSetName:DescribeReceiptRuleSet' :: DescribeReceiptRuleSet -> Text
ruleSetName} -> Text
ruleSetName) (\s :: DescribeReceiptRuleSet
s@DescribeReceiptRuleSet' {} Text
a -> DescribeReceiptRuleSet
s {$sel:ruleSetName:DescribeReceiptRuleSet' :: Text
ruleSetName = Text
a} :: DescribeReceiptRuleSet)
instance Core.AWSRequest DescribeReceiptRuleSet where
type
AWSResponse DescribeReceiptRuleSet =
DescribeReceiptRuleSetResponse
request :: DescribeReceiptRuleSet -> Request DescribeReceiptRuleSet
request = Service -> DescribeReceiptRuleSet -> Request DescribeReceiptRuleSet
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeReceiptRuleSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeReceiptRuleSet)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribeReceiptRuleSet))
-> Logger
-> Service
-> Proxy DescribeReceiptRuleSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeReceiptRuleSet)))
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
"DescribeReceiptRuleSetResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [ReceiptRule]
-> Maybe ReceiptRuleSetMetadata
-> Int
-> DescribeReceiptRuleSetResponse
DescribeReceiptRuleSetResponse'
(Maybe [ReceiptRule]
-> Maybe ReceiptRuleSetMetadata
-> Int
-> DescribeReceiptRuleSetResponse)
-> Either String (Maybe [ReceiptRule])
-> Either
String
(Maybe ReceiptRuleSetMetadata
-> Int -> DescribeReceiptRuleSetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Rules" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [ReceiptRule]))
-> Either String (Maybe [ReceiptRule])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ReceiptRule])
-> [Node] -> Either String (Maybe [ReceiptRule])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ReceiptRule]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either
String
(Maybe ReceiptRuleSetMetadata
-> Int -> DescribeReceiptRuleSetResponse)
-> Either String (Maybe ReceiptRuleSetMetadata)
-> Either String (Int -> DescribeReceiptRuleSetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ReceiptRuleSetMetadata)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Metadata")
Either String (Int -> DescribeReceiptRuleSetResponse)
-> Either String Int
-> Either String DescribeReceiptRuleSetResponse
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 DescribeReceiptRuleSet
instance Prelude.NFData DescribeReceiptRuleSet
instance Core.ToHeaders DescribeReceiptRuleSet where
toHeaders :: DescribeReceiptRuleSet -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeReceiptRuleSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeReceiptRuleSet where
toPath :: DescribeReceiptRuleSet -> ByteString
toPath = ByteString -> DescribeReceiptRuleSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeReceiptRuleSet where
toQuery :: DescribeReceiptRuleSet -> QueryString
toQuery DescribeReceiptRuleSet' {Text
ruleSetName :: Text
$sel:ruleSetName:DescribeReceiptRuleSet' :: DescribeReceiptRuleSet -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeReceiptRuleSet" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"RuleSetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
ruleSetName
]
data DescribeReceiptRuleSetResponse = DescribeReceiptRuleSetResponse'
{
DescribeReceiptRuleSetResponse -> Maybe [ReceiptRule]
rules :: Prelude.Maybe [ReceiptRule],
DescribeReceiptRuleSetResponse -> Maybe ReceiptRuleSetMetadata
metadata :: Prelude.Maybe ReceiptRuleSetMetadata,
DescribeReceiptRuleSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeReceiptRuleSetResponse
-> DescribeReceiptRuleSetResponse -> Bool
(DescribeReceiptRuleSetResponse
-> DescribeReceiptRuleSetResponse -> Bool)
-> (DescribeReceiptRuleSetResponse
-> DescribeReceiptRuleSetResponse -> Bool)
-> Eq DescribeReceiptRuleSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReceiptRuleSetResponse
-> DescribeReceiptRuleSetResponse -> Bool
$c/= :: DescribeReceiptRuleSetResponse
-> DescribeReceiptRuleSetResponse -> Bool
== :: DescribeReceiptRuleSetResponse
-> DescribeReceiptRuleSetResponse -> Bool
$c== :: DescribeReceiptRuleSetResponse
-> DescribeReceiptRuleSetResponse -> Bool
Prelude.Eq, ReadPrec [DescribeReceiptRuleSetResponse]
ReadPrec DescribeReceiptRuleSetResponse
Int -> ReadS DescribeReceiptRuleSetResponse
ReadS [DescribeReceiptRuleSetResponse]
(Int -> ReadS DescribeReceiptRuleSetResponse)
-> ReadS [DescribeReceiptRuleSetResponse]
-> ReadPrec DescribeReceiptRuleSetResponse
-> ReadPrec [DescribeReceiptRuleSetResponse]
-> Read DescribeReceiptRuleSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReceiptRuleSetResponse]
$creadListPrec :: ReadPrec [DescribeReceiptRuleSetResponse]
readPrec :: ReadPrec DescribeReceiptRuleSetResponse
$creadPrec :: ReadPrec DescribeReceiptRuleSetResponse
readList :: ReadS [DescribeReceiptRuleSetResponse]
$creadList :: ReadS [DescribeReceiptRuleSetResponse]
readsPrec :: Int -> ReadS DescribeReceiptRuleSetResponse
$creadsPrec :: Int -> ReadS DescribeReceiptRuleSetResponse
Prelude.Read, Int -> DescribeReceiptRuleSetResponse -> ShowS
[DescribeReceiptRuleSetResponse] -> ShowS
DescribeReceiptRuleSetResponse -> String
(Int -> DescribeReceiptRuleSetResponse -> ShowS)
-> (DescribeReceiptRuleSetResponse -> String)
-> ([DescribeReceiptRuleSetResponse] -> ShowS)
-> Show DescribeReceiptRuleSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReceiptRuleSetResponse] -> ShowS
$cshowList :: [DescribeReceiptRuleSetResponse] -> ShowS
show :: DescribeReceiptRuleSetResponse -> String
$cshow :: DescribeReceiptRuleSetResponse -> String
showsPrec :: Int -> DescribeReceiptRuleSetResponse -> ShowS
$cshowsPrec :: Int -> DescribeReceiptRuleSetResponse -> ShowS
Prelude.Show, (forall x.
DescribeReceiptRuleSetResponse
-> Rep DescribeReceiptRuleSetResponse x)
-> (forall x.
Rep DescribeReceiptRuleSetResponse x
-> DescribeReceiptRuleSetResponse)
-> Generic DescribeReceiptRuleSetResponse
forall x.
Rep DescribeReceiptRuleSetResponse x
-> DescribeReceiptRuleSetResponse
forall x.
DescribeReceiptRuleSetResponse
-> Rep DescribeReceiptRuleSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeReceiptRuleSetResponse x
-> DescribeReceiptRuleSetResponse
$cfrom :: forall x.
DescribeReceiptRuleSetResponse
-> Rep DescribeReceiptRuleSetResponse x
Prelude.Generic)
newDescribeReceiptRuleSetResponse ::
Prelude.Int ->
DescribeReceiptRuleSetResponse
newDescribeReceiptRuleSetResponse :: Int -> DescribeReceiptRuleSetResponse
newDescribeReceiptRuleSetResponse Int
pHttpStatus_ =
DescribeReceiptRuleSetResponse' :: Maybe [ReceiptRule]
-> Maybe ReceiptRuleSetMetadata
-> Int
-> DescribeReceiptRuleSetResponse
DescribeReceiptRuleSetResponse'
{ $sel:rules:DescribeReceiptRuleSetResponse' :: Maybe [ReceiptRule]
rules =
Maybe [ReceiptRule]
forall a. Maybe a
Prelude.Nothing,
$sel:metadata:DescribeReceiptRuleSetResponse' :: Maybe ReceiptRuleSetMetadata
metadata = Maybe ReceiptRuleSetMetadata
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeReceiptRuleSetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeReceiptRuleSetResponse_rules :: Lens.Lens' DescribeReceiptRuleSetResponse (Prelude.Maybe [ReceiptRule])
describeReceiptRuleSetResponse_rules :: (Maybe [ReceiptRule] -> f (Maybe [ReceiptRule]))
-> DescribeReceiptRuleSetResponse
-> f DescribeReceiptRuleSetResponse
describeReceiptRuleSetResponse_rules = (DescribeReceiptRuleSetResponse -> Maybe [ReceiptRule])
-> (DescribeReceiptRuleSetResponse
-> Maybe [ReceiptRule] -> DescribeReceiptRuleSetResponse)
-> Lens
DescribeReceiptRuleSetResponse
DescribeReceiptRuleSetResponse
(Maybe [ReceiptRule])
(Maybe [ReceiptRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRuleSetResponse' {Maybe [ReceiptRule]
rules :: Maybe [ReceiptRule]
$sel:rules:DescribeReceiptRuleSetResponse' :: DescribeReceiptRuleSetResponse -> Maybe [ReceiptRule]
rules} -> Maybe [ReceiptRule]
rules) (\s :: DescribeReceiptRuleSetResponse
s@DescribeReceiptRuleSetResponse' {} Maybe [ReceiptRule]
a -> DescribeReceiptRuleSetResponse
s {$sel:rules:DescribeReceiptRuleSetResponse' :: Maybe [ReceiptRule]
rules = Maybe [ReceiptRule]
a} :: DescribeReceiptRuleSetResponse) ((Maybe [ReceiptRule] -> f (Maybe [ReceiptRule]))
-> DescribeReceiptRuleSetResponse
-> f DescribeReceiptRuleSetResponse)
-> ((Maybe [ReceiptRule] -> f (Maybe [ReceiptRule]))
-> Maybe [ReceiptRule] -> f (Maybe [ReceiptRule]))
-> (Maybe [ReceiptRule] -> f (Maybe [ReceiptRule]))
-> DescribeReceiptRuleSetResponse
-> f DescribeReceiptRuleSetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ReceiptRule] [ReceiptRule] [ReceiptRule] [ReceiptRule]
-> Iso
(Maybe [ReceiptRule])
(Maybe [ReceiptRule])
(Maybe [ReceiptRule])
(Maybe [ReceiptRule])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [ReceiptRule] [ReceiptRule] [ReceiptRule] [ReceiptRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeReceiptRuleSetResponse_metadata :: Lens.Lens' DescribeReceiptRuleSetResponse (Prelude.Maybe ReceiptRuleSetMetadata)
describeReceiptRuleSetResponse_metadata :: (Maybe ReceiptRuleSetMetadata -> f (Maybe ReceiptRuleSetMetadata))
-> DescribeReceiptRuleSetResponse
-> f DescribeReceiptRuleSetResponse
describeReceiptRuleSetResponse_metadata = (DescribeReceiptRuleSetResponse -> Maybe ReceiptRuleSetMetadata)
-> (DescribeReceiptRuleSetResponse
-> Maybe ReceiptRuleSetMetadata -> DescribeReceiptRuleSetResponse)
-> Lens
DescribeReceiptRuleSetResponse
DescribeReceiptRuleSetResponse
(Maybe ReceiptRuleSetMetadata)
(Maybe ReceiptRuleSetMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRuleSetResponse' {Maybe ReceiptRuleSetMetadata
metadata :: Maybe ReceiptRuleSetMetadata
$sel:metadata:DescribeReceiptRuleSetResponse' :: DescribeReceiptRuleSetResponse -> Maybe ReceiptRuleSetMetadata
metadata} -> Maybe ReceiptRuleSetMetadata
metadata) (\s :: DescribeReceiptRuleSetResponse
s@DescribeReceiptRuleSetResponse' {} Maybe ReceiptRuleSetMetadata
a -> DescribeReceiptRuleSetResponse
s {$sel:metadata:DescribeReceiptRuleSetResponse' :: Maybe ReceiptRuleSetMetadata
metadata = Maybe ReceiptRuleSetMetadata
a} :: DescribeReceiptRuleSetResponse)
describeReceiptRuleSetResponse_httpStatus :: Lens.Lens' DescribeReceiptRuleSetResponse Prelude.Int
describeReceiptRuleSetResponse_httpStatus :: (Int -> f Int)
-> DescribeReceiptRuleSetResponse
-> f DescribeReceiptRuleSetResponse
describeReceiptRuleSetResponse_httpStatus = (DescribeReceiptRuleSetResponse -> Int)
-> (DescribeReceiptRuleSetResponse
-> Int -> DescribeReceiptRuleSetResponse)
-> Lens
DescribeReceiptRuleSetResponse
DescribeReceiptRuleSetResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReceiptRuleSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeReceiptRuleSetResponse' :: DescribeReceiptRuleSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeReceiptRuleSetResponse
s@DescribeReceiptRuleSetResponse' {} Int
a -> DescribeReceiptRuleSetResponse
s {$sel:httpStatus:DescribeReceiptRuleSetResponse' :: Int
httpStatus = Int
a} :: DescribeReceiptRuleSetResponse)
instance
Prelude.NFData
DescribeReceiptRuleSetResponse