{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
$c== :: UpdateReceiptRule -> UpdateReceiptRule -> Bool
== :: UpdateReceiptRule -> UpdateReceiptRule -> Bool
$c/= :: UpdateReceiptRule -> UpdateReceiptRule -> Bool
/= :: 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
$creadsPrec :: Int -> ReadS UpdateReceiptRule
readsPrec :: Int -> ReadS UpdateReceiptRule
$creadList :: ReadS [UpdateReceiptRule]
readList :: ReadS [UpdateReceiptRule]
$creadPrec :: ReadPrec UpdateReceiptRule
readPrec :: ReadPrec UpdateReceiptRule
$creadListPrec :: ReadPrec [UpdateReceiptRule]
readListPrec :: ReadPrec [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
$cshowsPrec :: Int -> UpdateReceiptRule -> ShowS
showsPrec :: Int -> UpdateReceiptRule -> ShowS
$cshow :: UpdateReceiptRule -> String
show :: UpdateReceiptRule -> String
$cshowList :: [UpdateReceiptRule] -> ShowS
showList :: [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
$cfrom :: forall x. UpdateReceiptRule -> Rep UpdateReceiptRule x
from :: forall x. UpdateReceiptRule -> Rep UpdateReceiptRule x
$cto :: forall x. Rep UpdateReceiptRule x -> UpdateReceiptRule
to :: forall x. Rep UpdateReceiptRule x -> UpdateReceiptRule
Prelude.Generic)
newUpdateReceiptRule ::
Prelude.Text ->
ReceiptRule ->
UpdateReceiptRule
newUpdateReceiptRule :: Text -> ReceiptRule -> UpdateReceiptRule
newUpdateReceiptRule Text
pRuleSetName_ ReceiptRule
pRule_ =
UpdateReceiptRule'
{ $sel:ruleSetName:UpdateReceiptRule' :: Text
ruleSetName = Text
pRuleSetName_,
$sel:rule:UpdateReceiptRule' :: ReceiptRule
rule = ReceiptRule
pRule_
}
updateReceiptRule_ruleSetName :: Lens.Lens' UpdateReceiptRule Prelude.Text
updateReceiptRule_ruleSetName :: Lens' UpdateReceiptRule Text
updateReceiptRule_ruleSetName = (UpdateReceiptRule -> Text)
-> (UpdateReceiptRule -> Text -> UpdateReceiptRule)
-> Lens' UpdateReceiptRule Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReceiptRule' {Text
$sel:ruleSetName:UpdateReceiptRule' :: UpdateReceiptRule -> Text
ruleSetName :: Text
ruleSetName} -> Text
ruleSetName) (\s :: UpdateReceiptRule
s@UpdateReceiptRule' {} Text
a -> UpdateReceiptRule
s {ruleSetName = a} :: UpdateReceiptRule)
updateReceiptRule_rule :: Lens.Lens' UpdateReceiptRule ReceiptRule
updateReceiptRule_rule :: Lens' UpdateReceiptRule ReceiptRule
updateReceiptRule_rule = (UpdateReceiptRule -> ReceiptRule)
-> (UpdateReceiptRule -> ReceiptRule -> UpdateReceiptRule)
-> Lens' UpdateReceiptRule ReceiptRule
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReceiptRule' {ReceiptRule
$sel:rule:UpdateReceiptRule' :: UpdateReceiptRule -> ReceiptRule
rule :: ReceiptRule
rule} -> ReceiptRule
rule) (\s :: UpdateReceiptRule
s@UpdateReceiptRule' {} ReceiptRule
a -> UpdateReceiptRule
s {rule = a} :: UpdateReceiptRule)
instance Core.AWSRequest UpdateReceiptRule where
type
AWSResponse UpdateReceiptRule =
UpdateReceiptRuleResponse
request :: (Service -> Service)
-> UpdateReceiptRule -> Request UpdateReceiptRule
request Service -> Service
overrides =
Service -> UpdateReceiptRule -> Request UpdateReceiptRule
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateReceiptRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateReceiptRule)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse UpdateReceiptRule))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateReceiptRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateReceiptRule)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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 a. a -> Either String a
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 where
hashWithSalt :: Int -> UpdateReceiptRule -> Int
hashWithSalt Int
_salt UpdateReceiptRule' {Text
ReceiptRule
$sel:ruleSetName:UpdateReceiptRule' :: UpdateReceiptRule -> Text
$sel:rule:UpdateReceiptRule' :: UpdateReceiptRule -> ReceiptRule
ruleSetName :: Text
rule :: ReceiptRule
..} =
Int
_salt
Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleSetName
Int -> ReceiptRule -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ReceiptRule
rule
instance Prelude.NFData UpdateReceiptRule where
rnf :: UpdateReceiptRule -> ()
rnf UpdateReceiptRule' {Text
ReceiptRule
$sel:ruleSetName:UpdateReceiptRule' :: UpdateReceiptRule -> Text
$sel:rule:UpdateReceiptRule' :: UpdateReceiptRule -> ReceiptRule
ruleSetName :: Text
rule :: ReceiptRule
..} =
Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleSetName
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` ReceiptRule -> ()
forall a. NFData a => a -> ()
Prelude.rnf ReceiptRule
rule
instance Data.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 Data.ToPath UpdateReceiptRule where
toPath :: UpdateReceiptRule -> ByteString
toPath = ByteString -> UpdateReceiptRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateReceiptRule where
toQuery :: UpdateReceiptRule -> QueryString
toQuery UpdateReceiptRule' {Text
ReceiptRule
$sel:ruleSetName:UpdateReceiptRule' :: UpdateReceiptRule -> Text
$sel:rule:UpdateReceiptRule' :: UpdateReceiptRule -> ReceiptRule
ruleSetName :: Text
rule :: ReceiptRule
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"UpdateReceiptRule" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"RuleSetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
ruleSetName,
ByteString
"Rule" ByteString -> ReceiptRule -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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
$c== :: UpdateReceiptRuleResponse -> UpdateReceiptRuleResponse -> Bool
== :: UpdateReceiptRuleResponse -> UpdateReceiptRuleResponse -> Bool
$c/= :: UpdateReceiptRuleResponse -> UpdateReceiptRuleResponse -> Bool
/= :: 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
$creadsPrec :: Int -> ReadS UpdateReceiptRuleResponse
readsPrec :: Int -> ReadS UpdateReceiptRuleResponse
$creadList :: ReadS [UpdateReceiptRuleResponse]
readList :: ReadS [UpdateReceiptRuleResponse]
$creadPrec :: ReadPrec UpdateReceiptRuleResponse
readPrec :: ReadPrec UpdateReceiptRuleResponse
$creadListPrec :: ReadPrec [UpdateReceiptRuleResponse]
readListPrec :: ReadPrec [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
$cshowsPrec :: Int -> UpdateReceiptRuleResponse -> ShowS
showsPrec :: Int -> UpdateReceiptRuleResponse -> ShowS
$cshow :: UpdateReceiptRuleResponse -> String
show :: UpdateReceiptRuleResponse -> String
$cshowList :: [UpdateReceiptRuleResponse] -> ShowS
showList :: [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
$cfrom :: forall x.
UpdateReceiptRuleResponse -> Rep UpdateReceiptRuleResponse x
from :: forall x.
UpdateReceiptRuleResponse -> Rep UpdateReceiptRuleResponse x
$cto :: forall x.
Rep UpdateReceiptRuleResponse x -> UpdateReceiptRuleResponse
to :: forall x.
Rep UpdateReceiptRuleResponse x -> UpdateReceiptRuleResponse
Prelude.Generic)
newUpdateReceiptRuleResponse ::
Prelude.Int ->
UpdateReceiptRuleResponse
newUpdateReceiptRuleResponse :: Int -> UpdateReceiptRuleResponse
newUpdateReceiptRuleResponse Int
pHttpStatus_ =
UpdateReceiptRuleResponse'
{ $sel:httpStatus:UpdateReceiptRuleResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateReceiptRuleResponse_httpStatus :: Lens.Lens' UpdateReceiptRuleResponse Prelude.Int
updateReceiptRuleResponse_httpStatus :: Lens' UpdateReceiptRuleResponse Int
updateReceiptRuleResponse_httpStatus = (UpdateReceiptRuleResponse -> Int)
-> (UpdateReceiptRuleResponse -> Int -> UpdateReceiptRuleResponse)
-> Lens' UpdateReceiptRuleResponse Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReceiptRuleResponse' {Int
$sel:httpStatus:UpdateReceiptRuleResponse' :: UpdateReceiptRuleResponse -> Int
httpStatus :: Int
httpStatus} -> Int
httpStatus) (\s :: UpdateReceiptRuleResponse
s@UpdateReceiptRuleResponse' {} Int
a -> UpdateReceiptRuleResponse
s {httpStatus = a} :: UpdateReceiptRuleResponse)
instance Prelude.NFData UpdateReceiptRuleResponse where
rnf :: UpdateReceiptRuleResponse -> ()
rnf UpdateReceiptRuleResponse' {Int
$sel:httpStatus:UpdateReceiptRuleResponse' :: UpdateReceiptRuleResponse -> Int
httpStatus :: Int
..} =
Int -> ()
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus