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