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