{-# 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
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]
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
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. 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'
{ $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 = 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 :: Lens' UpdateReceiptRule ReceiptRule
updateReceiptRule_rule = 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 :: (Service -> Service)
-> UpdateReceiptRule -> Request UpdateReceiptRule
request Service -> Service
overrides =
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 =
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'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (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
rule :: ReceiptRule
ruleSetName :: Text
$sel:rule:UpdateReceiptRule' :: UpdateReceiptRule -> ReceiptRule
$sel:ruleSetName:UpdateReceiptRule' :: UpdateReceiptRule -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleSetName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ReceiptRule
rule
instance Prelude.NFData UpdateReceiptRule where
rnf :: UpdateReceiptRule -> ()
rnf UpdateReceiptRule' {Text
ReceiptRule
rule :: ReceiptRule
ruleSetName :: Text
$sel:rule:UpdateReceiptRule' :: UpdateReceiptRule -> ReceiptRule
$sel:ruleSetName:UpdateReceiptRule' :: UpdateReceiptRule -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleSetName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ReceiptRule
rule
instance Data.ToHeaders UpdateReceiptRule where
toHeaders :: UpdateReceiptRule -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath UpdateReceiptRule where
toPath :: UpdateReceiptRule -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateReceiptRule where
toQuery :: UpdateReceiptRule -> QueryString
toQuery UpdateReceiptRule' {Text
ReceiptRule
rule :: ReceiptRule
ruleSetName :: Text
$sel:rule:UpdateReceiptRule' :: UpdateReceiptRule -> ReceiptRule
$sel:ruleSetName:UpdateReceiptRule' :: UpdateReceiptRule -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"UpdateReceiptRule" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"RuleSetName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
ruleSetName,
ByteString
"Rule" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ReceiptRule
rule
]
data UpdateReceiptRuleResponse = UpdateReceiptRuleResponse'
{
UpdateReceiptRuleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateReceiptRuleResponse -> UpdateReceiptRuleResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:UpdateReceiptRuleResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateReceiptRuleResponse_httpStatus :: Lens.Lens' UpdateReceiptRuleResponse Prelude.Int
updateReceiptRuleResponse_httpStatus :: Lens' UpdateReceiptRuleResponse Int
updateReceiptRuleResponse_httpStatus = 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 where
rnf :: UpdateReceiptRuleResponse -> ()
rnf UpdateReceiptRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateReceiptRuleResponse' :: UpdateReceiptRuleResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus