{-# 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.SetReceiptRulePosition
(
SetReceiptRulePosition (..),
newSetReceiptRulePosition,
setReceiptRulePosition_after,
setReceiptRulePosition_ruleSetName,
setReceiptRulePosition_ruleName,
SetReceiptRulePositionResponse (..),
newSetReceiptRulePositionResponse,
setReceiptRulePositionResponse_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 SetReceiptRulePosition = SetReceiptRulePosition'
{
SetReceiptRulePosition -> Maybe Text
after :: Prelude.Maybe Prelude.Text,
SetReceiptRulePosition -> Text
ruleSetName :: Prelude.Text,
SetReceiptRulePosition -> Text
ruleName :: Prelude.Text
}
deriving (SetReceiptRulePosition -> SetReceiptRulePosition -> Bool
(SetReceiptRulePosition -> SetReceiptRulePosition -> Bool)
-> (SetReceiptRulePosition -> SetReceiptRulePosition -> Bool)
-> Eq SetReceiptRulePosition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetReceiptRulePosition -> SetReceiptRulePosition -> Bool
$c/= :: SetReceiptRulePosition -> SetReceiptRulePosition -> Bool
== :: SetReceiptRulePosition -> SetReceiptRulePosition -> Bool
$c== :: SetReceiptRulePosition -> SetReceiptRulePosition -> Bool
Prelude.Eq, ReadPrec [SetReceiptRulePosition]
ReadPrec SetReceiptRulePosition
Int -> ReadS SetReceiptRulePosition
ReadS [SetReceiptRulePosition]
(Int -> ReadS SetReceiptRulePosition)
-> ReadS [SetReceiptRulePosition]
-> ReadPrec SetReceiptRulePosition
-> ReadPrec [SetReceiptRulePosition]
-> Read SetReceiptRulePosition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetReceiptRulePosition]
$creadListPrec :: ReadPrec [SetReceiptRulePosition]
readPrec :: ReadPrec SetReceiptRulePosition
$creadPrec :: ReadPrec SetReceiptRulePosition
readList :: ReadS [SetReceiptRulePosition]
$creadList :: ReadS [SetReceiptRulePosition]
readsPrec :: Int -> ReadS SetReceiptRulePosition
$creadsPrec :: Int -> ReadS SetReceiptRulePosition
Prelude.Read, Int -> SetReceiptRulePosition -> ShowS
[SetReceiptRulePosition] -> ShowS
SetReceiptRulePosition -> String
(Int -> SetReceiptRulePosition -> ShowS)
-> (SetReceiptRulePosition -> String)
-> ([SetReceiptRulePosition] -> ShowS)
-> Show SetReceiptRulePosition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetReceiptRulePosition] -> ShowS
$cshowList :: [SetReceiptRulePosition] -> ShowS
show :: SetReceiptRulePosition -> String
$cshow :: SetReceiptRulePosition -> String
showsPrec :: Int -> SetReceiptRulePosition -> ShowS
$cshowsPrec :: Int -> SetReceiptRulePosition -> ShowS
Prelude.Show, (forall x. SetReceiptRulePosition -> Rep SetReceiptRulePosition x)
-> (forall x.
Rep SetReceiptRulePosition x -> SetReceiptRulePosition)
-> Generic SetReceiptRulePosition
forall x. Rep SetReceiptRulePosition x -> SetReceiptRulePosition
forall x. SetReceiptRulePosition -> Rep SetReceiptRulePosition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetReceiptRulePosition x -> SetReceiptRulePosition
$cfrom :: forall x. SetReceiptRulePosition -> Rep SetReceiptRulePosition x
Prelude.Generic)
newSetReceiptRulePosition ::
Prelude.Text ->
Prelude.Text ->
SetReceiptRulePosition
newSetReceiptRulePosition :: Text -> Text -> SetReceiptRulePosition
newSetReceiptRulePosition Text
pRuleSetName_ Text
pRuleName_ =
SetReceiptRulePosition' :: Maybe Text -> Text -> Text -> SetReceiptRulePosition
SetReceiptRulePosition'
{ $sel:after:SetReceiptRulePosition' :: Maybe Text
after = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ruleSetName:SetReceiptRulePosition' :: Text
ruleSetName = Text
pRuleSetName_,
$sel:ruleName:SetReceiptRulePosition' :: Text
ruleName = Text
pRuleName_
}
setReceiptRulePosition_after :: Lens.Lens' SetReceiptRulePosition (Prelude.Maybe Prelude.Text)
setReceiptRulePosition_after :: (Maybe Text -> f (Maybe Text))
-> SetReceiptRulePosition -> f SetReceiptRulePosition
setReceiptRulePosition_after = (SetReceiptRulePosition -> Maybe Text)
-> (SetReceiptRulePosition -> Maybe Text -> SetReceiptRulePosition)
-> Lens
SetReceiptRulePosition
SetReceiptRulePosition
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetReceiptRulePosition' {Maybe Text
after :: Maybe Text
$sel:after:SetReceiptRulePosition' :: SetReceiptRulePosition -> Maybe Text
after} -> Maybe Text
after) (\s :: SetReceiptRulePosition
s@SetReceiptRulePosition' {} Maybe Text
a -> SetReceiptRulePosition
s {$sel:after:SetReceiptRulePosition' :: Maybe Text
after = Maybe Text
a} :: SetReceiptRulePosition)
setReceiptRulePosition_ruleSetName :: Lens.Lens' SetReceiptRulePosition Prelude.Text
setReceiptRulePosition_ruleSetName :: (Text -> f Text)
-> SetReceiptRulePosition -> f SetReceiptRulePosition
setReceiptRulePosition_ruleSetName = (SetReceiptRulePosition -> Text)
-> (SetReceiptRulePosition -> Text -> SetReceiptRulePosition)
-> Lens SetReceiptRulePosition SetReceiptRulePosition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetReceiptRulePosition' {Text
ruleSetName :: Text
$sel:ruleSetName:SetReceiptRulePosition' :: SetReceiptRulePosition -> Text
ruleSetName} -> Text
ruleSetName) (\s :: SetReceiptRulePosition
s@SetReceiptRulePosition' {} Text
a -> SetReceiptRulePosition
s {$sel:ruleSetName:SetReceiptRulePosition' :: Text
ruleSetName = Text
a} :: SetReceiptRulePosition)
setReceiptRulePosition_ruleName :: Lens.Lens' SetReceiptRulePosition Prelude.Text
setReceiptRulePosition_ruleName :: (Text -> f Text)
-> SetReceiptRulePosition -> f SetReceiptRulePosition
setReceiptRulePosition_ruleName = (SetReceiptRulePosition -> Text)
-> (SetReceiptRulePosition -> Text -> SetReceiptRulePosition)
-> Lens SetReceiptRulePosition SetReceiptRulePosition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetReceiptRulePosition' {Text
ruleName :: Text
$sel:ruleName:SetReceiptRulePosition' :: SetReceiptRulePosition -> Text
ruleName} -> Text
ruleName) (\s :: SetReceiptRulePosition
s@SetReceiptRulePosition' {} Text
a -> SetReceiptRulePosition
s {$sel:ruleName:SetReceiptRulePosition' :: Text
ruleName = Text
a} :: SetReceiptRulePosition)
instance Core.AWSRequest SetReceiptRulePosition where
type
AWSResponse SetReceiptRulePosition =
SetReceiptRulePositionResponse
request :: SetReceiptRulePosition -> Request SetReceiptRulePosition
request = Service -> SetReceiptRulePosition -> Request SetReceiptRulePosition
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy SetReceiptRulePosition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetReceiptRulePosition)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse SetReceiptRulePosition))
-> Logger
-> Service
-> Proxy SetReceiptRulePosition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetReceiptRulePosition)))
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
"SetReceiptRulePositionResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> SetReceiptRulePositionResponse
SetReceiptRulePositionResponse'
(Int -> SetReceiptRulePositionResponse)
-> Either String Int
-> Either String SetReceiptRulePositionResponse
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 SetReceiptRulePosition
instance Prelude.NFData SetReceiptRulePosition
instance Core.ToHeaders SetReceiptRulePosition where
toHeaders :: SetReceiptRulePosition -> ResponseHeaders
toHeaders = ResponseHeaders -> SetReceiptRulePosition -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath SetReceiptRulePosition where
toPath :: SetReceiptRulePosition -> ByteString
toPath = ByteString -> SetReceiptRulePosition -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SetReceiptRulePosition where
toQuery :: SetReceiptRulePosition -> QueryString
toQuery SetReceiptRulePosition' {Maybe Text
Text
ruleName :: Text
ruleSetName :: Text
after :: Maybe Text
$sel:ruleName:SetReceiptRulePosition' :: SetReceiptRulePosition -> Text
$sel:ruleSetName:SetReceiptRulePosition' :: SetReceiptRulePosition -> Text
$sel:after:SetReceiptRulePosition' :: SetReceiptRulePosition -> Maybe 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
"SetReceiptRulePosition" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"After" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
after,
ByteString
"RuleSetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
ruleSetName,
ByteString
"RuleName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
ruleName
]
data SetReceiptRulePositionResponse = SetReceiptRulePositionResponse'
{
SetReceiptRulePositionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SetReceiptRulePositionResponse
-> SetReceiptRulePositionResponse -> Bool
(SetReceiptRulePositionResponse
-> SetReceiptRulePositionResponse -> Bool)
-> (SetReceiptRulePositionResponse
-> SetReceiptRulePositionResponse -> Bool)
-> Eq SetReceiptRulePositionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetReceiptRulePositionResponse
-> SetReceiptRulePositionResponse -> Bool
$c/= :: SetReceiptRulePositionResponse
-> SetReceiptRulePositionResponse -> Bool
== :: SetReceiptRulePositionResponse
-> SetReceiptRulePositionResponse -> Bool
$c== :: SetReceiptRulePositionResponse
-> SetReceiptRulePositionResponse -> Bool
Prelude.Eq, ReadPrec [SetReceiptRulePositionResponse]
ReadPrec SetReceiptRulePositionResponse
Int -> ReadS SetReceiptRulePositionResponse
ReadS [SetReceiptRulePositionResponse]
(Int -> ReadS SetReceiptRulePositionResponse)
-> ReadS [SetReceiptRulePositionResponse]
-> ReadPrec SetReceiptRulePositionResponse
-> ReadPrec [SetReceiptRulePositionResponse]
-> Read SetReceiptRulePositionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetReceiptRulePositionResponse]
$creadListPrec :: ReadPrec [SetReceiptRulePositionResponse]
readPrec :: ReadPrec SetReceiptRulePositionResponse
$creadPrec :: ReadPrec SetReceiptRulePositionResponse
readList :: ReadS [SetReceiptRulePositionResponse]
$creadList :: ReadS [SetReceiptRulePositionResponse]
readsPrec :: Int -> ReadS SetReceiptRulePositionResponse
$creadsPrec :: Int -> ReadS SetReceiptRulePositionResponse
Prelude.Read, Int -> SetReceiptRulePositionResponse -> ShowS
[SetReceiptRulePositionResponse] -> ShowS
SetReceiptRulePositionResponse -> String
(Int -> SetReceiptRulePositionResponse -> ShowS)
-> (SetReceiptRulePositionResponse -> String)
-> ([SetReceiptRulePositionResponse] -> ShowS)
-> Show SetReceiptRulePositionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetReceiptRulePositionResponse] -> ShowS
$cshowList :: [SetReceiptRulePositionResponse] -> ShowS
show :: SetReceiptRulePositionResponse -> String
$cshow :: SetReceiptRulePositionResponse -> String
showsPrec :: Int -> SetReceiptRulePositionResponse -> ShowS
$cshowsPrec :: Int -> SetReceiptRulePositionResponse -> ShowS
Prelude.Show, (forall x.
SetReceiptRulePositionResponse
-> Rep SetReceiptRulePositionResponse x)
-> (forall x.
Rep SetReceiptRulePositionResponse x
-> SetReceiptRulePositionResponse)
-> Generic SetReceiptRulePositionResponse
forall x.
Rep SetReceiptRulePositionResponse x
-> SetReceiptRulePositionResponse
forall x.
SetReceiptRulePositionResponse
-> Rep SetReceiptRulePositionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetReceiptRulePositionResponse x
-> SetReceiptRulePositionResponse
$cfrom :: forall x.
SetReceiptRulePositionResponse
-> Rep SetReceiptRulePositionResponse x
Prelude.Generic)
newSetReceiptRulePositionResponse ::
Prelude.Int ->
SetReceiptRulePositionResponse
newSetReceiptRulePositionResponse :: Int -> SetReceiptRulePositionResponse
newSetReceiptRulePositionResponse Int
pHttpStatus_ =
SetReceiptRulePositionResponse' :: Int -> SetReceiptRulePositionResponse
SetReceiptRulePositionResponse'
{ $sel:httpStatus:SetReceiptRulePositionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
setReceiptRulePositionResponse_httpStatus :: Lens.Lens' SetReceiptRulePositionResponse Prelude.Int
setReceiptRulePositionResponse_httpStatus :: (Int -> f Int)
-> SetReceiptRulePositionResponse
-> f SetReceiptRulePositionResponse
setReceiptRulePositionResponse_httpStatus = (SetReceiptRulePositionResponse -> Int)
-> (SetReceiptRulePositionResponse
-> Int -> SetReceiptRulePositionResponse)
-> Lens
SetReceiptRulePositionResponse
SetReceiptRulePositionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetReceiptRulePositionResponse' {Int
httpStatus :: Int
$sel:httpStatus:SetReceiptRulePositionResponse' :: SetReceiptRulePositionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SetReceiptRulePositionResponse
s@SetReceiptRulePositionResponse' {} Int
a -> SetReceiptRulePositionResponse
s {$sel:httpStatus:SetReceiptRulePositionResponse' :: Int
httpStatus = Int
a} :: SetReceiptRulePositionResponse)
instance
Prelude.NFData
SetReceiptRulePositionResponse