{-# 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.DeleteTemplate
(
DeleteTemplate (..),
newDeleteTemplate,
deleteTemplate_templateName,
DeleteTemplateResponse (..),
newDeleteTemplateResponse,
deleteTemplateResponse_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 DeleteTemplate = DeleteTemplate'
{
DeleteTemplate -> Text
templateName :: Prelude.Text
}
deriving (DeleteTemplate -> DeleteTemplate -> Bool
(DeleteTemplate -> DeleteTemplate -> Bool)
-> (DeleteTemplate -> DeleteTemplate -> Bool) -> Eq DeleteTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTemplate -> DeleteTemplate -> Bool
$c/= :: DeleteTemplate -> DeleteTemplate -> Bool
== :: DeleteTemplate -> DeleteTemplate -> Bool
$c== :: DeleteTemplate -> DeleteTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteTemplate]
ReadPrec DeleteTemplate
Int -> ReadS DeleteTemplate
ReadS [DeleteTemplate]
(Int -> ReadS DeleteTemplate)
-> ReadS [DeleteTemplate]
-> ReadPrec DeleteTemplate
-> ReadPrec [DeleteTemplate]
-> Read DeleteTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTemplate]
$creadListPrec :: ReadPrec [DeleteTemplate]
readPrec :: ReadPrec DeleteTemplate
$creadPrec :: ReadPrec DeleteTemplate
readList :: ReadS [DeleteTemplate]
$creadList :: ReadS [DeleteTemplate]
readsPrec :: Int -> ReadS DeleteTemplate
$creadsPrec :: Int -> ReadS DeleteTemplate
Prelude.Read, Int -> DeleteTemplate -> ShowS
[DeleteTemplate] -> ShowS
DeleteTemplate -> String
(Int -> DeleteTemplate -> ShowS)
-> (DeleteTemplate -> String)
-> ([DeleteTemplate] -> ShowS)
-> Show DeleteTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTemplate] -> ShowS
$cshowList :: [DeleteTemplate] -> ShowS
show :: DeleteTemplate -> String
$cshow :: DeleteTemplate -> String
showsPrec :: Int -> DeleteTemplate -> ShowS
$cshowsPrec :: Int -> DeleteTemplate -> ShowS
Prelude.Show, (forall x. DeleteTemplate -> Rep DeleteTemplate x)
-> (forall x. Rep DeleteTemplate x -> DeleteTemplate)
-> Generic DeleteTemplate
forall x. Rep DeleteTemplate x -> DeleteTemplate
forall x. DeleteTemplate -> Rep DeleteTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTemplate x -> DeleteTemplate
$cfrom :: forall x. DeleteTemplate -> Rep DeleteTemplate x
Prelude.Generic)
newDeleteTemplate ::
Prelude.Text ->
DeleteTemplate
newDeleteTemplate :: Text -> DeleteTemplate
newDeleteTemplate Text
pTemplateName_ =
DeleteTemplate' :: Text -> DeleteTemplate
DeleteTemplate' {$sel:templateName:DeleteTemplate' :: Text
templateName = Text
pTemplateName_}
deleteTemplate_templateName :: Lens.Lens' DeleteTemplate Prelude.Text
deleteTemplate_templateName :: (Text -> f Text) -> DeleteTemplate -> f DeleteTemplate
deleteTemplate_templateName = (DeleteTemplate -> Text)
-> (DeleteTemplate -> Text -> DeleteTemplate)
-> Lens DeleteTemplate DeleteTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTemplate' {Text
templateName :: Text
$sel:templateName:DeleteTemplate' :: DeleteTemplate -> Text
templateName} -> Text
templateName) (\s :: DeleteTemplate
s@DeleteTemplate' {} Text
a -> DeleteTemplate
s {$sel:templateName:DeleteTemplate' :: Text
templateName = Text
a} :: DeleteTemplate)
instance Core.AWSRequest DeleteTemplate where
type
AWSResponse DeleteTemplate =
DeleteTemplateResponse
request :: DeleteTemplate -> Request DeleteTemplate
request = Service -> DeleteTemplate -> Request DeleteTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTemplate)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteTemplate))
-> Logger
-> Service
-> Proxy DeleteTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTemplate)))
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
"DeleteTemplateResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> DeleteTemplateResponse
DeleteTemplateResponse'
(Int -> DeleteTemplateResponse)
-> Either String Int -> Either String DeleteTemplateResponse
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 DeleteTemplate
instance Prelude.NFData DeleteTemplate
instance Core.ToHeaders DeleteTemplate where
toHeaders :: DeleteTemplate -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteTemplate where
toPath :: DeleteTemplate -> ByteString
toPath = ByteString -> DeleteTemplate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteTemplate where
toQuery :: DeleteTemplate -> QueryString
toQuery DeleteTemplate' {Text
templateName :: Text
$sel:templateName:DeleteTemplate' :: DeleteTemplate -> 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
"DeleteTemplate" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"TemplateName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
templateName
]
data DeleteTemplateResponse = DeleteTemplateResponse'
{
DeleteTemplateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteTemplateResponse -> DeleteTemplateResponse -> Bool
(DeleteTemplateResponse -> DeleteTemplateResponse -> Bool)
-> (DeleteTemplateResponse -> DeleteTemplateResponse -> Bool)
-> Eq DeleteTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTemplateResponse -> DeleteTemplateResponse -> Bool
$c/= :: DeleteTemplateResponse -> DeleteTemplateResponse -> Bool
== :: DeleteTemplateResponse -> DeleteTemplateResponse -> Bool
$c== :: DeleteTemplateResponse -> DeleteTemplateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTemplateResponse]
ReadPrec DeleteTemplateResponse
Int -> ReadS DeleteTemplateResponse
ReadS [DeleteTemplateResponse]
(Int -> ReadS DeleteTemplateResponse)
-> ReadS [DeleteTemplateResponse]
-> ReadPrec DeleteTemplateResponse
-> ReadPrec [DeleteTemplateResponse]
-> Read DeleteTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTemplateResponse]
$creadListPrec :: ReadPrec [DeleteTemplateResponse]
readPrec :: ReadPrec DeleteTemplateResponse
$creadPrec :: ReadPrec DeleteTemplateResponse
readList :: ReadS [DeleteTemplateResponse]
$creadList :: ReadS [DeleteTemplateResponse]
readsPrec :: Int -> ReadS DeleteTemplateResponse
$creadsPrec :: Int -> ReadS DeleteTemplateResponse
Prelude.Read, Int -> DeleteTemplateResponse -> ShowS
[DeleteTemplateResponse] -> ShowS
DeleteTemplateResponse -> String
(Int -> DeleteTemplateResponse -> ShowS)
-> (DeleteTemplateResponse -> String)
-> ([DeleteTemplateResponse] -> ShowS)
-> Show DeleteTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTemplateResponse] -> ShowS
$cshowList :: [DeleteTemplateResponse] -> ShowS
show :: DeleteTemplateResponse -> String
$cshow :: DeleteTemplateResponse -> String
showsPrec :: Int -> DeleteTemplateResponse -> ShowS
$cshowsPrec :: Int -> DeleteTemplateResponse -> ShowS
Prelude.Show, (forall x. DeleteTemplateResponse -> Rep DeleteTemplateResponse x)
-> (forall x.
Rep DeleteTemplateResponse x -> DeleteTemplateResponse)
-> Generic DeleteTemplateResponse
forall x. Rep DeleteTemplateResponse x -> DeleteTemplateResponse
forall x. DeleteTemplateResponse -> Rep DeleteTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTemplateResponse x -> DeleteTemplateResponse
$cfrom :: forall x. DeleteTemplateResponse -> Rep DeleteTemplateResponse x
Prelude.Generic)
newDeleteTemplateResponse ::
Prelude.Int ->
DeleteTemplateResponse
newDeleteTemplateResponse :: Int -> DeleteTemplateResponse
newDeleteTemplateResponse Int
pHttpStatus_ =
DeleteTemplateResponse' :: Int -> DeleteTemplateResponse
DeleteTemplateResponse' {$sel:httpStatus:DeleteTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteTemplateResponse_httpStatus :: Lens.Lens' DeleteTemplateResponse Prelude.Int
deleteTemplateResponse_httpStatus :: (Int -> f Int)
-> DeleteTemplateResponse -> f DeleteTemplateResponse
deleteTemplateResponse_httpStatus = (DeleteTemplateResponse -> Int)
-> (DeleteTemplateResponse -> Int -> DeleteTemplateResponse)
-> Lens DeleteTemplateResponse DeleteTemplateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteTemplateResponse' :: DeleteTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteTemplateResponse
s@DeleteTemplateResponse' {} Int
a -> DeleteTemplateResponse
s {$sel:httpStatus:DeleteTemplateResponse' :: Int
httpStatus = Int
a} :: DeleteTemplateResponse)
instance Prelude.NFData DeleteTemplateResponse