{-# 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.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 CreateReceiptRuleSet = CreateReceiptRuleSet'
{
CreateReceiptRuleSet -> Text
ruleSetName :: Prelude.Text
}
deriving (CreateReceiptRuleSet -> CreateReceiptRuleSet -> Bool
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]
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
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. 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' {$sel:ruleSetName:CreateReceiptRuleSet' :: Text
ruleSetName = Text
pRuleSetName_}
createReceiptRuleSet_ruleSetName :: Lens.Lens' CreateReceiptRuleSet Prelude.Text
createReceiptRuleSet_ruleSetName :: Lens' CreateReceiptRuleSet Text
createReceiptRuleSet_ruleSetName = 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 :: (Service -> Service)
-> CreateReceiptRuleSet -> Request CreateReceiptRuleSet
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 CreateReceiptRuleSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateReceiptRuleSet)))
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
"CreateReceiptRuleSetResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> CreateReceiptRuleSetResponse
CreateReceiptRuleSetResponse'
forall (f :: * -> *) a b. Functor 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 CreateReceiptRuleSet where
hashWithSalt :: Int -> CreateReceiptRuleSet -> Int
hashWithSalt Int
_salt CreateReceiptRuleSet' {Text
ruleSetName :: Text
$sel:ruleSetName:CreateReceiptRuleSet' :: CreateReceiptRuleSet -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleSetName
instance Prelude.NFData CreateReceiptRuleSet where
rnf :: CreateReceiptRuleSet -> ()
rnf CreateReceiptRuleSet' {Text
ruleSetName :: Text
$sel:ruleSetName:CreateReceiptRuleSet' :: CreateReceiptRuleSet -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleSetName
instance Data.ToHeaders CreateReceiptRuleSet where
toHeaders :: CreateReceiptRuleSet -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath CreateReceiptRuleSet where
toPath :: CreateReceiptRuleSet -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateReceiptRuleSet where
toQuery :: CreateReceiptRuleSet -> QueryString
toQuery CreateReceiptRuleSet' {Text
ruleSetName :: Text
$sel:ruleSetName:CreateReceiptRuleSet' :: CreateReceiptRuleSet -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateReceiptRuleSet" :: 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
]
data CreateReceiptRuleSetResponse = CreateReceiptRuleSetResponse'
{
CreateReceiptRuleSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateReceiptRuleSetResponse
-> CreateReceiptRuleSetResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:CreateReceiptRuleSetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createReceiptRuleSetResponse_httpStatus :: Lens.Lens' CreateReceiptRuleSetResponse Prelude.Int
createReceiptRuleSetResponse_httpStatus :: Lens' CreateReceiptRuleSetResponse Int
createReceiptRuleSetResponse_httpStatus = 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 where
rnf :: CreateReceiptRuleSetResponse -> ()
rnf CreateReceiptRuleSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateReceiptRuleSetResponse' :: CreateReceiptRuleSetResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus