{-# 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.CreateReceiptRuleSet
(
CreateReceiptRuleSet (..),
newCreateReceiptRuleSet,
createReceiptRuleSet_ruleSetName,
CreateReceiptRuleSetResponse (..),
newCreateReceiptRuleSetResponse,
createReceiptRuleSetResponse_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 CreateReceiptRuleSet = CreateReceiptRuleSet'
{
CreateReceiptRuleSet -> Text
ruleSetName :: Prelude.Text
}
deriving (CreateReceiptRuleSet -> CreateReceiptRuleSet -> Bool
(CreateReceiptRuleSet -> CreateReceiptRuleSet -> Bool)
-> (CreateReceiptRuleSet -> CreateReceiptRuleSet -> Bool)
-> Eq CreateReceiptRuleSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateReceiptRuleSet -> CreateReceiptRuleSet -> Bool
$c/= :: CreateReceiptRuleSet -> CreateReceiptRuleSet -> Bool
== :: CreateReceiptRuleSet -> CreateReceiptRuleSet -> Bool
$c== :: CreateReceiptRuleSet -> CreateReceiptRuleSet -> Bool
Prelude.Eq, ReadPrec [CreateReceiptRuleSet]
ReadPrec CreateReceiptRuleSet
Int -> ReadS CreateReceiptRuleSet
ReadS [CreateReceiptRuleSet]
(Int -> ReadS CreateReceiptRuleSet)
-> ReadS [CreateReceiptRuleSet]
-> ReadPrec CreateReceiptRuleSet
-> ReadPrec [CreateReceiptRuleSet]
-> Read CreateReceiptRuleSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateReceiptRuleSet]
$creadListPrec :: ReadPrec [CreateReceiptRuleSet]
readPrec :: ReadPrec CreateReceiptRuleSet
$creadPrec :: ReadPrec CreateReceiptRuleSet
readList :: ReadS [CreateReceiptRuleSet]
$creadList :: ReadS [CreateReceiptRuleSet]
readsPrec :: Int -> ReadS CreateReceiptRuleSet
$creadsPrec :: Int -> ReadS CreateReceiptRuleSet
Prelude.Read, Int -> CreateReceiptRuleSet -> ShowS
[CreateReceiptRuleSet] -> ShowS
CreateReceiptRuleSet -> String
(Int -> CreateReceiptRuleSet -> ShowS)
-> (CreateReceiptRuleSet -> String)
-> ([CreateReceiptRuleSet] -> ShowS)
-> Show CreateReceiptRuleSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateReceiptRuleSet] -> ShowS
$cshowList :: [CreateReceiptRuleSet] -> ShowS
show :: CreateReceiptRuleSet -> String
$cshow :: CreateReceiptRuleSet -> String
showsPrec :: Int -> CreateReceiptRuleSet -> ShowS
$cshowsPrec :: Int -> CreateReceiptRuleSet -> ShowS
Prelude.Show, (forall x. CreateReceiptRuleSet -> Rep CreateReceiptRuleSet x)
-> (forall x. Rep CreateReceiptRuleSet x -> CreateReceiptRuleSet)
-> Generic CreateReceiptRuleSet
forall x. Rep CreateReceiptRuleSet x -> CreateReceiptRuleSet
forall x. CreateReceiptRuleSet -> Rep CreateReceiptRuleSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateReceiptRuleSet x -> CreateReceiptRuleSet
$cfrom :: forall x. CreateReceiptRuleSet -> Rep CreateReceiptRuleSet x
Prelude.Generic)
newCreateReceiptRuleSet ::
Prelude.Text ->
CreateReceiptRuleSet
newCreateReceiptRuleSet :: Text -> CreateReceiptRuleSet
newCreateReceiptRuleSet Text
pRuleSetName_ =
CreateReceiptRuleSet' :: Text -> CreateReceiptRuleSet
CreateReceiptRuleSet' {$sel:ruleSetName:CreateReceiptRuleSet' :: Text
ruleSetName = Text
pRuleSetName_}
createReceiptRuleSet_ruleSetName :: Lens.Lens' CreateReceiptRuleSet Prelude.Text
createReceiptRuleSet_ruleSetName :: (Text -> f Text) -> CreateReceiptRuleSet -> f CreateReceiptRuleSet
createReceiptRuleSet_ruleSetName = (CreateReceiptRuleSet -> Text)
-> (CreateReceiptRuleSet -> Text -> CreateReceiptRuleSet)
-> Lens CreateReceiptRuleSet CreateReceiptRuleSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReceiptRuleSet' {Text
ruleSetName :: Text
$sel:ruleSetName:CreateReceiptRuleSet' :: CreateReceiptRuleSet -> Text
ruleSetName} -> Text
ruleSetName) (\s :: CreateReceiptRuleSet
s@CreateReceiptRuleSet' {} Text
a -> CreateReceiptRuleSet
s {$sel:ruleSetName:CreateReceiptRuleSet' :: Text
ruleSetName = Text
a} :: CreateReceiptRuleSet)
instance Core.AWSRequest CreateReceiptRuleSet where
type
AWSResponse CreateReceiptRuleSet =
CreateReceiptRuleSetResponse
request :: CreateReceiptRuleSet -> Request CreateReceiptRuleSet
request = Service -> CreateReceiptRuleSet -> Request CreateReceiptRuleSet
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CreateReceiptRuleSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateReceiptRuleSet)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CreateReceiptRuleSet))
-> Logger
-> Service
-> Proxy CreateReceiptRuleSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateReceiptRuleSet)))
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
"CreateReceiptRuleSetResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> CreateReceiptRuleSetResponse
CreateReceiptRuleSetResponse'
(Int -> CreateReceiptRuleSetResponse)
-> Either String Int -> Either String CreateReceiptRuleSetResponse
forall (f :: * -> *) a b. Functor 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 CreateReceiptRuleSet
instance Prelude.NFData CreateReceiptRuleSet
instance Core.ToHeaders CreateReceiptRuleSet where
toHeaders :: CreateReceiptRuleSet -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateReceiptRuleSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CreateReceiptRuleSet where
toPath :: CreateReceiptRuleSet -> ByteString
toPath = ByteString -> CreateReceiptRuleSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateReceiptRuleSet where
toQuery :: CreateReceiptRuleSet -> QueryString
toQuery CreateReceiptRuleSet' {Text
ruleSetName :: Text
$sel:ruleSetName:CreateReceiptRuleSet' :: CreateReceiptRuleSet -> 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
"CreateReceiptRuleSet" :: 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 CreateReceiptRuleSetResponse = CreateReceiptRuleSetResponse'
{
CreateReceiptRuleSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateReceiptRuleSetResponse
-> CreateReceiptRuleSetResponse -> Bool
(CreateReceiptRuleSetResponse
-> CreateReceiptRuleSetResponse -> Bool)
-> (CreateReceiptRuleSetResponse
-> CreateReceiptRuleSetResponse -> Bool)
-> Eq CreateReceiptRuleSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateReceiptRuleSetResponse
-> CreateReceiptRuleSetResponse -> Bool
$c/= :: CreateReceiptRuleSetResponse
-> CreateReceiptRuleSetResponse -> Bool
== :: CreateReceiptRuleSetResponse
-> CreateReceiptRuleSetResponse -> Bool
$c== :: CreateReceiptRuleSetResponse
-> CreateReceiptRuleSetResponse -> Bool
Prelude.Eq, ReadPrec [CreateReceiptRuleSetResponse]
ReadPrec CreateReceiptRuleSetResponse
Int -> ReadS CreateReceiptRuleSetResponse
ReadS [CreateReceiptRuleSetResponse]
(Int -> ReadS CreateReceiptRuleSetResponse)
-> ReadS [CreateReceiptRuleSetResponse]
-> ReadPrec CreateReceiptRuleSetResponse
-> ReadPrec [CreateReceiptRuleSetResponse]
-> Read CreateReceiptRuleSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateReceiptRuleSetResponse]
$creadListPrec :: ReadPrec [CreateReceiptRuleSetResponse]
readPrec :: ReadPrec CreateReceiptRuleSetResponse
$creadPrec :: ReadPrec CreateReceiptRuleSetResponse
readList :: ReadS [CreateReceiptRuleSetResponse]
$creadList :: ReadS [CreateReceiptRuleSetResponse]
readsPrec :: Int -> ReadS CreateReceiptRuleSetResponse
$creadsPrec :: Int -> ReadS CreateReceiptRuleSetResponse
Prelude.Read, Int -> CreateReceiptRuleSetResponse -> ShowS
[CreateReceiptRuleSetResponse] -> ShowS
CreateReceiptRuleSetResponse -> String
(Int -> CreateReceiptRuleSetResponse -> ShowS)
-> (CreateReceiptRuleSetResponse -> String)
-> ([CreateReceiptRuleSetResponse] -> ShowS)
-> Show CreateReceiptRuleSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateReceiptRuleSetResponse] -> ShowS
$cshowList :: [CreateReceiptRuleSetResponse] -> ShowS
show :: CreateReceiptRuleSetResponse -> String
$cshow :: CreateReceiptRuleSetResponse -> String
showsPrec :: Int -> CreateReceiptRuleSetResponse -> ShowS
$cshowsPrec :: Int -> CreateReceiptRuleSetResponse -> ShowS
Prelude.Show, (forall x.
CreateReceiptRuleSetResponse -> Rep CreateReceiptRuleSetResponse x)
-> (forall x.
Rep CreateReceiptRuleSetResponse x -> CreateReceiptRuleSetResponse)
-> Generic CreateReceiptRuleSetResponse
forall x.
Rep CreateReceiptRuleSetResponse x -> CreateReceiptRuleSetResponse
forall x.
CreateReceiptRuleSetResponse -> Rep CreateReceiptRuleSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateReceiptRuleSetResponse x -> CreateReceiptRuleSetResponse
$cfrom :: forall x.
CreateReceiptRuleSetResponse -> Rep CreateReceiptRuleSetResponse x
Prelude.Generic)
newCreateReceiptRuleSetResponse ::
Prelude.Int ->
CreateReceiptRuleSetResponse
newCreateReceiptRuleSetResponse :: Int -> CreateReceiptRuleSetResponse
newCreateReceiptRuleSetResponse Int
pHttpStatus_ =
CreateReceiptRuleSetResponse' :: Int -> CreateReceiptRuleSetResponse
CreateReceiptRuleSetResponse'
{ $sel:httpStatus:CreateReceiptRuleSetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createReceiptRuleSetResponse_httpStatus :: Lens.Lens' CreateReceiptRuleSetResponse Prelude.Int
createReceiptRuleSetResponse_httpStatus :: (Int -> f Int)
-> CreateReceiptRuleSetResponse -> f CreateReceiptRuleSetResponse
createReceiptRuleSetResponse_httpStatus = (CreateReceiptRuleSetResponse -> Int)
-> (CreateReceiptRuleSetResponse
-> Int -> CreateReceiptRuleSetResponse)
-> Lens
CreateReceiptRuleSetResponse CreateReceiptRuleSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReceiptRuleSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateReceiptRuleSetResponse' :: CreateReceiptRuleSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateReceiptRuleSetResponse
s@CreateReceiptRuleSetResponse' {} Int
a -> CreateReceiptRuleSetResponse
s {$sel:httpStatus:CreateReceiptRuleSetResponse' :: Int
httpStatus = Int
a} :: CreateReceiptRuleSetResponse)
instance Prelude.NFData CreateReceiptRuleSetResponse