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