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