{-# 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.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 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
$c== :: DeleteReceiptRule -> DeleteReceiptRule -> Bool
== :: DeleteReceiptRule -> DeleteReceiptRule -> Bool
$c/= :: DeleteReceiptRule -> DeleteReceiptRule -> Bool
/= :: 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
$creadsPrec :: Int -> ReadS DeleteReceiptRule
readsPrec :: Int -> ReadS DeleteReceiptRule
$creadList :: ReadS [DeleteReceiptRule]
readList :: ReadS [DeleteReceiptRule]
$creadPrec :: ReadPrec DeleteReceiptRule
readPrec :: ReadPrec DeleteReceiptRule
$creadListPrec :: ReadPrec [DeleteReceiptRule]
readListPrec :: ReadPrec [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
$cshowsPrec :: Int -> DeleteReceiptRule -> ShowS
showsPrec :: Int -> DeleteReceiptRule -> ShowS
$cshow :: DeleteReceiptRule -> String
show :: DeleteReceiptRule -> String
$cshowList :: [DeleteReceiptRule] -> ShowS
showList :: [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
$cfrom :: forall x. DeleteReceiptRule -> Rep DeleteReceiptRule x
from :: forall x. DeleteReceiptRule -> Rep DeleteReceiptRule x
$cto :: forall x. Rep DeleteReceiptRule x -> DeleteReceiptRule
to :: forall x. Rep DeleteReceiptRule x -> DeleteReceiptRule
Prelude.Generic)
newDeleteReceiptRule ::
Prelude.Text ->
Prelude.Text ->
DeleteReceiptRule
newDeleteReceiptRule :: Text -> Text -> DeleteReceiptRule
newDeleteReceiptRule Text
pRuleSetName_ Text
pRuleName_ =
DeleteReceiptRule'
{ $sel:ruleSetName:DeleteReceiptRule' :: Text
ruleSetName = Text
pRuleSetName_,
$sel:ruleName:DeleteReceiptRule' :: Text
ruleName = Text
pRuleName_
}
deleteReceiptRule_ruleSetName :: Lens.Lens' DeleteReceiptRule Prelude.Text
deleteReceiptRule_ruleSetName :: Lens' DeleteReceiptRule Text
deleteReceiptRule_ruleSetName = (DeleteReceiptRule -> Text)
-> (DeleteReceiptRule -> Text -> DeleteReceiptRule)
-> Lens' DeleteReceiptRule Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReceiptRule' {Text
$sel:ruleSetName:DeleteReceiptRule' :: DeleteReceiptRule -> Text
ruleSetName :: Text
ruleSetName} -> Text
ruleSetName) (\s :: DeleteReceiptRule
s@DeleteReceiptRule' {} Text
a -> DeleteReceiptRule
s {ruleSetName = a} :: DeleteReceiptRule)
deleteReceiptRule_ruleName :: Lens.Lens' DeleteReceiptRule Prelude.Text
deleteReceiptRule_ruleName :: Lens' DeleteReceiptRule Text
deleteReceiptRule_ruleName = (DeleteReceiptRule -> Text)
-> (DeleteReceiptRule -> Text -> DeleteReceiptRule)
-> Lens' DeleteReceiptRule Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReceiptRule' {Text
$sel:ruleName:DeleteReceiptRule' :: DeleteReceiptRule -> Text
ruleName :: Text
ruleName} -> Text
ruleName) (\s :: DeleteReceiptRule
s@DeleteReceiptRule' {} Text
a -> DeleteReceiptRule
s {ruleName = a} :: DeleteReceiptRule)
instance Core.AWSRequest DeleteReceiptRule where
type
AWSResponse DeleteReceiptRule =
DeleteReceiptRuleResponse
request :: (Service -> Service)
-> DeleteReceiptRule -> Request DeleteReceiptRule
request Service -> Service
overrides =
Service -> DeleteReceiptRule -> Request DeleteReceiptRule
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 DeleteReceiptRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteReceiptRule)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteReceiptRule))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteReceiptRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteReceiptRule)))
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
"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 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 DeleteReceiptRule where
hashWithSalt :: Int -> DeleteReceiptRule -> Int
hashWithSalt Int
_salt DeleteReceiptRule' {Text
$sel:ruleSetName:DeleteReceiptRule' :: DeleteReceiptRule -> Text
$sel:ruleName:DeleteReceiptRule' :: DeleteReceiptRule -> Text
ruleSetName :: Text
ruleName :: Text
..} =
Int
_salt
Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleSetName
Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleName
instance Prelude.NFData DeleteReceiptRule where
rnf :: DeleteReceiptRule -> ()
rnf DeleteReceiptRule' {Text
$sel:ruleSetName:DeleteReceiptRule' :: DeleteReceiptRule -> Text
$sel:ruleName:DeleteReceiptRule' :: DeleteReceiptRule -> Text
ruleSetName :: Text
ruleName :: Text
..} =
Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleSetName
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleName
instance Data.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 Data.ToPath DeleteReceiptRule where
toPath :: DeleteReceiptRule -> ByteString
toPath = ByteString -> DeleteReceiptRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteReceiptRule where
toQuery :: DeleteReceiptRule -> QueryString
toQuery DeleteReceiptRule' {Text
$sel:ruleSetName:DeleteReceiptRule' :: DeleteReceiptRule -> Text
$sel:ruleName:DeleteReceiptRule' :: DeleteReceiptRule -> Text
ruleSetName :: Text
ruleName :: Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DeleteReceiptRule" :: 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
"RuleName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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
$c== :: DeleteReceiptRuleResponse -> DeleteReceiptRuleResponse -> Bool
== :: DeleteReceiptRuleResponse -> DeleteReceiptRuleResponse -> Bool
$c/= :: DeleteReceiptRuleResponse -> DeleteReceiptRuleResponse -> Bool
/= :: 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
$creadsPrec :: Int -> ReadS DeleteReceiptRuleResponse
readsPrec :: Int -> ReadS DeleteReceiptRuleResponse
$creadList :: ReadS [DeleteReceiptRuleResponse]
readList :: ReadS [DeleteReceiptRuleResponse]
$creadPrec :: ReadPrec DeleteReceiptRuleResponse
readPrec :: ReadPrec DeleteReceiptRuleResponse
$creadListPrec :: ReadPrec [DeleteReceiptRuleResponse]
readListPrec :: ReadPrec [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
$cshowsPrec :: Int -> DeleteReceiptRuleResponse -> ShowS
showsPrec :: Int -> DeleteReceiptRuleResponse -> ShowS
$cshow :: DeleteReceiptRuleResponse -> String
show :: DeleteReceiptRuleResponse -> String
$cshowList :: [DeleteReceiptRuleResponse] -> ShowS
showList :: [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
$cfrom :: forall x.
DeleteReceiptRuleResponse -> Rep DeleteReceiptRuleResponse x
from :: forall x.
DeleteReceiptRuleResponse -> Rep DeleteReceiptRuleResponse x
$cto :: forall x.
Rep DeleteReceiptRuleResponse x -> DeleteReceiptRuleResponse
to :: forall x.
Rep DeleteReceiptRuleResponse x -> DeleteReceiptRuleResponse
Prelude.Generic)
newDeleteReceiptRuleResponse ::
Prelude.Int ->
DeleteReceiptRuleResponse
newDeleteReceiptRuleResponse :: Int -> DeleteReceiptRuleResponse
newDeleteReceiptRuleResponse Int
pHttpStatus_ =
DeleteReceiptRuleResponse'
{ $sel:httpStatus:DeleteReceiptRuleResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteReceiptRuleResponse_httpStatus :: Lens.Lens' DeleteReceiptRuleResponse Prelude.Int
deleteReceiptRuleResponse_httpStatus :: Lens' DeleteReceiptRuleResponse Int
deleteReceiptRuleResponse_httpStatus = (DeleteReceiptRuleResponse -> Int)
-> (DeleteReceiptRuleResponse -> Int -> DeleteReceiptRuleResponse)
-> Lens' DeleteReceiptRuleResponse Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReceiptRuleResponse' {Int
$sel:httpStatus:DeleteReceiptRuleResponse' :: DeleteReceiptRuleResponse -> Int
httpStatus :: Int
httpStatus} -> Int
httpStatus) (\s :: DeleteReceiptRuleResponse
s@DeleteReceiptRuleResponse' {} Int
a -> DeleteReceiptRuleResponse
s {httpStatus = a} :: DeleteReceiptRuleResponse)
instance Prelude.NFData DeleteReceiptRuleResponse where
rnf :: DeleteReceiptRuleResponse -> ()
rnf DeleteReceiptRuleResponse' {Int
$sel:httpStatus:DeleteReceiptRuleResponse' :: DeleteReceiptRuleResponse -> Int
httpStatus :: Int
..} =
Int -> ()
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus