{-# 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.ReorderReceiptRuleSet
(
ReorderReceiptRuleSet (..),
newReorderReceiptRuleSet,
reorderReceiptRuleSet_ruleSetName,
reorderReceiptRuleSet_ruleNames,
ReorderReceiptRuleSetResponse (..),
newReorderReceiptRuleSetResponse,
reorderReceiptRuleSetResponse_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 ReorderReceiptRuleSet = ReorderReceiptRuleSet'
{
ReorderReceiptRuleSet -> Text
ruleSetName :: Prelude.Text,
ReorderReceiptRuleSet -> [Text]
ruleNames :: [Prelude.Text]
}
deriving (ReorderReceiptRuleSet -> ReorderReceiptRuleSet -> Bool
(ReorderReceiptRuleSet -> ReorderReceiptRuleSet -> Bool)
-> (ReorderReceiptRuleSet -> ReorderReceiptRuleSet -> Bool)
-> Eq ReorderReceiptRuleSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReorderReceiptRuleSet -> ReorderReceiptRuleSet -> Bool
$c/= :: ReorderReceiptRuleSet -> ReorderReceiptRuleSet -> Bool
== :: ReorderReceiptRuleSet -> ReorderReceiptRuleSet -> Bool
$c== :: ReorderReceiptRuleSet -> ReorderReceiptRuleSet -> Bool
Prelude.Eq, ReadPrec [ReorderReceiptRuleSet]
ReadPrec ReorderReceiptRuleSet
Int -> ReadS ReorderReceiptRuleSet
ReadS [ReorderReceiptRuleSet]
(Int -> ReadS ReorderReceiptRuleSet)
-> ReadS [ReorderReceiptRuleSet]
-> ReadPrec ReorderReceiptRuleSet
-> ReadPrec [ReorderReceiptRuleSet]
-> Read ReorderReceiptRuleSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReorderReceiptRuleSet]
$creadListPrec :: ReadPrec [ReorderReceiptRuleSet]
readPrec :: ReadPrec ReorderReceiptRuleSet
$creadPrec :: ReadPrec ReorderReceiptRuleSet
readList :: ReadS [ReorderReceiptRuleSet]
$creadList :: ReadS [ReorderReceiptRuleSet]
readsPrec :: Int -> ReadS ReorderReceiptRuleSet
$creadsPrec :: Int -> ReadS ReorderReceiptRuleSet
Prelude.Read, Int -> ReorderReceiptRuleSet -> ShowS
[ReorderReceiptRuleSet] -> ShowS
ReorderReceiptRuleSet -> String
(Int -> ReorderReceiptRuleSet -> ShowS)
-> (ReorderReceiptRuleSet -> String)
-> ([ReorderReceiptRuleSet] -> ShowS)
-> Show ReorderReceiptRuleSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReorderReceiptRuleSet] -> ShowS
$cshowList :: [ReorderReceiptRuleSet] -> ShowS
show :: ReorderReceiptRuleSet -> String
$cshow :: ReorderReceiptRuleSet -> String
showsPrec :: Int -> ReorderReceiptRuleSet -> ShowS
$cshowsPrec :: Int -> ReorderReceiptRuleSet -> ShowS
Prelude.Show, (forall x. ReorderReceiptRuleSet -> Rep ReorderReceiptRuleSet x)
-> (forall x. Rep ReorderReceiptRuleSet x -> ReorderReceiptRuleSet)
-> Generic ReorderReceiptRuleSet
forall x. Rep ReorderReceiptRuleSet x -> ReorderReceiptRuleSet
forall x. ReorderReceiptRuleSet -> Rep ReorderReceiptRuleSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReorderReceiptRuleSet x -> ReorderReceiptRuleSet
$cfrom :: forall x. ReorderReceiptRuleSet -> Rep ReorderReceiptRuleSet x
Prelude.Generic)
newReorderReceiptRuleSet ::
Prelude.Text ->
ReorderReceiptRuleSet
newReorderReceiptRuleSet :: Text -> ReorderReceiptRuleSet
newReorderReceiptRuleSet Text
pRuleSetName_ =
ReorderReceiptRuleSet' :: Text -> [Text] -> ReorderReceiptRuleSet
ReorderReceiptRuleSet'
{ $sel:ruleSetName:ReorderReceiptRuleSet' :: Text
ruleSetName = Text
pRuleSetName_,
$sel:ruleNames:ReorderReceiptRuleSet' :: [Text]
ruleNames = [Text]
forall a. Monoid a => a
Prelude.mempty
}
reorderReceiptRuleSet_ruleSetName :: Lens.Lens' ReorderReceiptRuleSet Prelude.Text
reorderReceiptRuleSet_ruleSetName :: (Text -> f Text)
-> ReorderReceiptRuleSet -> f ReorderReceiptRuleSet
reorderReceiptRuleSet_ruleSetName = (ReorderReceiptRuleSet -> Text)
-> (ReorderReceiptRuleSet -> Text -> ReorderReceiptRuleSet)
-> Lens ReorderReceiptRuleSet ReorderReceiptRuleSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReorderReceiptRuleSet' {Text
ruleSetName :: Text
$sel:ruleSetName:ReorderReceiptRuleSet' :: ReorderReceiptRuleSet -> Text
ruleSetName} -> Text
ruleSetName) (\s :: ReorderReceiptRuleSet
s@ReorderReceiptRuleSet' {} Text
a -> ReorderReceiptRuleSet
s {$sel:ruleSetName:ReorderReceiptRuleSet' :: Text
ruleSetName = Text
a} :: ReorderReceiptRuleSet)
reorderReceiptRuleSet_ruleNames :: Lens.Lens' ReorderReceiptRuleSet [Prelude.Text]
reorderReceiptRuleSet_ruleNames :: ([Text] -> f [Text])
-> ReorderReceiptRuleSet -> f ReorderReceiptRuleSet
reorderReceiptRuleSet_ruleNames = (ReorderReceiptRuleSet -> [Text])
-> (ReorderReceiptRuleSet -> [Text] -> ReorderReceiptRuleSet)
-> Lens ReorderReceiptRuleSet ReorderReceiptRuleSet [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReorderReceiptRuleSet' {[Text]
ruleNames :: [Text]
$sel:ruleNames:ReorderReceiptRuleSet' :: ReorderReceiptRuleSet -> [Text]
ruleNames} -> [Text]
ruleNames) (\s :: ReorderReceiptRuleSet
s@ReorderReceiptRuleSet' {} [Text]
a -> ReorderReceiptRuleSet
s {$sel:ruleNames:ReorderReceiptRuleSet' :: [Text]
ruleNames = [Text]
a} :: ReorderReceiptRuleSet) (([Text] -> f [Text])
-> ReorderReceiptRuleSet -> f ReorderReceiptRuleSet)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ReorderReceiptRuleSet
-> f ReorderReceiptRuleSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest ReorderReceiptRuleSet where
type
AWSResponse ReorderReceiptRuleSet =
ReorderReceiptRuleSetResponse
request :: ReorderReceiptRuleSet -> Request ReorderReceiptRuleSet
request = Service -> ReorderReceiptRuleSet -> Request ReorderReceiptRuleSet
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ReorderReceiptRuleSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ReorderReceiptRuleSet)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ReorderReceiptRuleSet))
-> Logger
-> Service
-> Proxy ReorderReceiptRuleSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ReorderReceiptRuleSet)))
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
"ReorderReceiptRuleSetResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> ReorderReceiptRuleSetResponse
ReorderReceiptRuleSetResponse'
(Int -> ReorderReceiptRuleSetResponse)
-> Either String Int -> Either String ReorderReceiptRuleSetResponse
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 ReorderReceiptRuleSet
instance Prelude.NFData ReorderReceiptRuleSet
instance Core.ToHeaders ReorderReceiptRuleSet where
toHeaders :: ReorderReceiptRuleSet -> ResponseHeaders
toHeaders = ResponseHeaders -> ReorderReceiptRuleSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ReorderReceiptRuleSet where
toPath :: ReorderReceiptRuleSet -> ByteString
toPath = ByteString -> ReorderReceiptRuleSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ReorderReceiptRuleSet where
toQuery :: ReorderReceiptRuleSet -> QueryString
toQuery ReorderReceiptRuleSet' {[Text]
Text
ruleNames :: [Text]
ruleSetName :: Text
$sel:ruleNames:ReorderReceiptRuleSet' :: ReorderReceiptRuleSet -> [Text]
$sel:ruleSetName:ReorderReceiptRuleSet' :: ReorderReceiptRuleSet -> 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
"ReorderReceiptRuleSet" :: 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,
ByteString
"RuleNames"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [Text]
ruleNames
]
data ReorderReceiptRuleSetResponse = ReorderReceiptRuleSetResponse'
{
ReorderReceiptRuleSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ReorderReceiptRuleSetResponse
-> ReorderReceiptRuleSetResponse -> Bool
(ReorderReceiptRuleSetResponse
-> ReorderReceiptRuleSetResponse -> Bool)
-> (ReorderReceiptRuleSetResponse
-> ReorderReceiptRuleSetResponse -> Bool)
-> Eq ReorderReceiptRuleSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReorderReceiptRuleSetResponse
-> ReorderReceiptRuleSetResponse -> Bool
$c/= :: ReorderReceiptRuleSetResponse
-> ReorderReceiptRuleSetResponse -> Bool
== :: ReorderReceiptRuleSetResponse
-> ReorderReceiptRuleSetResponse -> Bool
$c== :: ReorderReceiptRuleSetResponse
-> ReorderReceiptRuleSetResponse -> Bool
Prelude.Eq, ReadPrec [ReorderReceiptRuleSetResponse]
ReadPrec ReorderReceiptRuleSetResponse
Int -> ReadS ReorderReceiptRuleSetResponse
ReadS [ReorderReceiptRuleSetResponse]
(Int -> ReadS ReorderReceiptRuleSetResponse)
-> ReadS [ReorderReceiptRuleSetResponse]
-> ReadPrec ReorderReceiptRuleSetResponse
-> ReadPrec [ReorderReceiptRuleSetResponse]
-> Read ReorderReceiptRuleSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReorderReceiptRuleSetResponse]
$creadListPrec :: ReadPrec [ReorderReceiptRuleSetResponse]
readPrec :: ReadPrec ReorderReceiptRuleSetResponse
$creadPrec :: ReadPrec ReorderReceiptRuleSetResponse
readList :: ReadS [ReorderReceiptRuleSetResponse]
$creadList :: ReadS [ReorderReceiptRuleSetResponse]
readsPrec :: Int -> ReadS ReorderReceiptRuleSetResponse
$creadsPrec :: Int -> ReadS ReorderReceiptRuleSetResponse
Prelude.Read, Int -> ReorderReceiptRuleSetResponse -> ShowS
[ReorderReceiptRuleSetResponse] -> ShowS
ReorderReceiptRuleSetResponse -> String
(Int -> ReorderReceiptRuleSetResponse -> ShowS)
-> (ReorderReceiptRuleSetResponse -> String)
-> ([ReorderReceiptRuleSetResponse] -> ShowS)
-> Show ReorderReceiptRuleSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReorderReceiptRuleSetResponse] -> ShowS
$cshowList :: [ReorderReceiptRuleSetResponse] -> ShowS
show :: ReorderReceiptRuleSetResponse -> String
$cshow :: ReorderReceiptRuleSetResponse -> String
showsPrec :: Int -> ReorderReceiptRuleSetResponse -> ShowS
$cshowsPrec :: Int -> ReorderReceiptRuleSetResponse -> ShowS
Prelude.Show, (forall x.
ReorderReceiptRuleSetResponse
-> Rep ReorderReceiptRuleSetResponse x)
-> (forall x.
Rep ReorderReceiptRuleSetResponse x
-> ReorderReceiptRuleSetResponse)
-> Generic ReorderReceiptRuleSetResponse
forall x.
Rep ReorderReceiptRuleSetResponse x
-> ReorderReceiptRuleSetResponse
forall x.
ReorderReceiptRuleSetResponse
-> Rep ReorderReceiptRuleSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReorderReceiptRuleSetResponse x
-> ReorderReceiptRuleSetResponse
$cfrom :: forall x.
ReorderReceiptRuleSetResponse
-> Rep ReorderReceiptRuleSetResponse x
Prelude.Generic)
newReorderReceiptRuleSetResponse ::
Prelude.Int ->
ReorderReceiptRuleSetResponse
newReorderReceiptRuleSetResponse :: Int -> ReorderReceiptRuleSetResponse
newReorderReceiptRuleSetResponse Int
pHttpStatus_ =
ReorderReceiptRuleSetResponse' :: Int -> ReorderReceiptRuleSetResponse
ReorderReceiptRuleSetResponse'
{ $sel:httpStatus:ReorderReceiptRuleSetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
reorderReceiptRuleSetResponse_httpStatus :: Lens.Lens' ReorderReceiptRuleSetResponse Prelude.Int
reorderReceiptRuleSetResponse_httpStatus :: (Int -> f Int)
-> ReorderReceiptRuleSetResponse -> f ReorderReceiptRuleSetResponse
reorderReceiptRuleSetResponse_httpStatus = (ReorderReceiptRuleSetResponse -> Int)
-> (ReorderReceiptRuleSetResponse
-> Int -> ReorderReceiptRuleSetResponse)
-> Lens
ReorderReceiptRuleSetResponse ReorderReceiptRuleSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReorderReceiptRuleSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:ReorderReceiptRuleSetResponse' :: ReorderReceiptRuleSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ReorderReceiptRuleSetResponse
s@ReorderReceiptRuleSetResponse' {} Int
a -> ReorderReceiptRuleSetResponse
s {$sel:httpStatus:ReorderReceiptRuleSetResponse' :: Int
httpStatus = Int
a} :: ReorderReceiptRuleSetResponse)
instance Prelude.NFData ReorderReceiptRuleSetResponse