{-# 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.SESV2.DeleteEmailTemplate
(
DeleteEmailTemplate (..),
newDeleteEmailTemplate,
deleteEmailTemplate_templateName,
DeleteEmailTemplateResponse (..),
newDeleteEmailTemplateResponse,
deleteEmailTemplateResponse_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.SESV2.Types
data DeleteEmailTemplate = DeleteEmailTemplate'
{
DeleteEmailTemplate -> Text
templateName :: Prelude.Text
}
deriving (DeleteEmailTemplate -> DeleteEmailTemplate -> Bool
(DeleteEmailTemplate -> DeleteEmailTemplate -> Bool)
-> (DeleteEmailTemplate -> DeleteEmailTemplate -> Bool)
-> Eq DeleteEmailTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteEmailTemplate -> DeleteEmailTemplate -> Bool
$c/= :: DeleteEmailTemplate -> DeleteEmailTemplate -> Bool
== :: DeleteEmailTemplate -> DeleteEmailTemplate -> Bool
$c== :: DeleteEmailTemplate -> DeleteEmailTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteEmailTemplate]
ReadPrec DeleteEmailTemplate
Int -> ReadS DeleteEmailTemplate
ReadS [DeleteEmailTemplate]
(Int -> ReadS DeleteEmailTemplate)
-> ReadS [DeleteEmailTemplate]
-> ReadPrec DeleteEmailTemplate
-> ReadPrec [DeleteEmailTemplate]
-> Read DeleteEmailTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteEmailTemplate]
$creadListPrec :: ReadPrec [DeleteEmailTemplate]
readPrec :: ReadPrec DeleteEmailTemplate
$creadPrec :: ReadPrec DeleteEmailTemplate
readList :: ReadS [DeleteEmailTemplate]
$creadList :: ReadS [DeleteEmailTemplate]
readsPrec :: Int -> ReadS DeleteEmailTemplate
$creadsPrec :: Int -> ReadS DeleteEmailTemplate
Prelude.Read, Int -> DeleteEmailTemplate -> ShowS
[DeleteEmailTemplate] -> ShowS
DeleteEmailTemplate -> String
(Int -> DeleteEmailTemplate -> ShowS)
-> (DeleteEmailTemplate -> String)
-> ([DeleteEmailTemplate] -> ShowS)
-> Show DeleteEmailTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteEmailTemplate] -> ShowS
$cshowList :: [DeleteEmailTemplate] -> ShowS
show :: DeleteEmailTemplate -> String
$cshow :: DeleteEmailTemplate -> String
showsPrec :: Int -> DeleteEmailTemplate -> ShowS
$cshowsPrec :: Int -> DeleteEmailTemplate -> ShowS
Prelude.Show, (forall x. DeleteEmailTemplate -> Rep DeleteEmailTemplate x)
-> (forall x. Rep DeleteEmailTemplate x -> DeleteEmailTemplate)
-> Generic DeleteEmailTemplate
forall x. Rep DeleteEmailTemplate x -> DeleteEmailTemplate
forall x. DeleteEmailTemplate -> Rep DeleteEmailTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteEmailTemplate x -> DeleteEmailTemplate
$cfrom :: forall x. DeleteEmailTemplate -> Rep DeleteEmailTemplate x
Prelude.Generic)
newDeleteEmailTemplate ::
Prelude.Text ->
DeleteEmailTemplate
newDeleteEmailTemplate :: Text -> DeleteEmailTemplate
newDeleteEmailTemplate Text
pTemplateName_ =
DeleteEmailTemplate' :: Text -> DeleteEmailTemplate
DeleteEmailTemplate' {$sel:templateName:DeleteEmailTemplate' :: Text
templateName = Text
pTemplateName_}
deleteEmailTemplate_templateName :: Lens.Lens' DeleteEmailTemplate Prelude.Text
deleteEmailTemplate_templateName :: (Text -> f Text) -> DeleteEmailTemplate -> f DeleteEmailTemplate
deleteEmailTemplate_templateName = (DeleteEmailTemplate -> Text)
-> (DeleteEmailTemplate -> Text -> DeleteEmailTemplate)
-> Lens DeleteEmailTemplate DeleteEmailTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEmailTemplate' {Text
templateName :: Text
$sel:templateName:DeleteEmailTemplate' :: DeleteEmailTemplate -> Text
templateName} -> Text
templateName) (\s :: DeleteEmailTemplate
s@DeleteEmailTemplate' {} Text
a -> DeleteEmailTemplate
s {$sel:templateName:DeleteEmailTemplate' :: Text
templateName = Text
a} :: DeleteEmailTemplate)
instance Core.AWSRequest DeleteEmailTemplate where
type
AWSResponse DeleteEmailTemplate =
DeleteEmailTemplateResponse
request :: DeleteEmailTemplate -> Request DeleteEmailTemplate
request = Service -> DeleteEmailTemplate -> Request DeleteEmailTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteEmailTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteEmailTemplate)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteEmailTemplate))
-> Logger
-> Service
-> Proxy DeleteEmailTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteEmailTemplate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteEmailTemplateResponse
DeleteEmailTemplateResponse'
(Int -> DeleteEmailTemplateResponse)
-> Either String Int -> Either String DeleteEmailTemplateResponse
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 DeleteEmailTemplate
instance Prelude.NFData DeleteEmailTemplate
instance Core.ToHeaders DeleteEmailTemplate where
toHeaders :: DeleteEmailTemplate -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteEmailTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DeleteEmailTemplate where
toPath :: DeleteEmailTemplate -> ByteString
toPath DeleteEmailTemplate' {Text
templateName :: Text
$sel:templateName:DeleteEmailTemplate' :: DeleteEmailTemplate -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v2/email/templates/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateName]
instance Core.ToQuery DeleteEmailTemplate where
toQuery :: DeleteEmailTemplate -> QueryString
toQuery = QueryString -> DeleteEmailTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteEmailTemplateResponse = DeleteEmailTemplateResponse'
{
DeleteEmailTemplateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteEmailTemplateResponse -> DeleteEmailTemplateResponse -> Bool
(DeleteEmailTemplateResponse
-> DeleteEmailTemplateResponse -> Bool)
-> (DeleteEmailTemplateResponse
-> DeleteEmailTemplateResponse -> Bool)
-> Eq DeleteEmailTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteEmailTemplateResponse -> DeleteEmailTemplateResponse -> Bool
$c/= :: DeleteEmailTemplateResponse -> DeleteEmailTemplateResponse -> Bool
== :: DeleteEmailTemplateResponse -> DeleteEmailTemplateResponse -> Bool
$c== :: DeleteEmailTemplateResponse -> DeleteEmailTemplateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteEmailTemplateResponse]
ReadPrec DeleteEmailTemplateResponse
Int -> ReadS DeleteEmailTemplateResponse
ReadS [DeleteEmailTemplateResponse]
(Int -> ReadS DeleteEmailTemplateResponse)
-> ReadS [DeleteEmailTemplateResponse]
-> ReadPrec DeleteEmailTemplateResponse
-> ReadPrec [DeleteEmailTemplateResponse]
-> Read DeleteEmailTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteEmailTemplateResponse]
$creadListPrec :: ReadPrec [DeleteEmailTemplateResponse]
readPrec :: ReadPrec DeleteEmailTemplateResponse
$creadPrec :: ReadPrec DeleteEmailTemplateResponse
readList :: ReadS [DeleteEmailTemplateResponse]
$creadList :: ReadS [DeleteEmailTemplateResponse]
readsPrec :: Int -> ReadS DeleteEmailTemplateResponse
$creadsPrec :: Int -> ReadS DeleteEmailTemplateResponse
Prelude.Read, Int -> DeleteEmailTemplateResponse -> ShowS
[DeleteEmailTemplateResponse] -> ShowS
DeleteEmailTemplateResponse -> String
(Int -> DeleteEmailTemplateResponse -> ShowS)
-> (DeleteEmailTemplateResponse -> String)
-> ([DeleteEmailTemplateResponse] -> ShowS)
-> Show DeleteEmailTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteEmailTemplateResponse] -> ShowS
$cshowList :: [DeleteEmailTemplateResponse] -> ShowS
show :: DeleteEmailTemplateResponse -> String
$cshow :: DeleteEmailTemplateResponse -> String
showsPrec :: Int -> DeleteEmailTemplateResponse -> ShowS
$cshowsPrec :: Int -> DeleteEmailTemplateResponse -> ShowS
Prelude.Show, (forall x.
DeleteEmailTemplateResponse -> Rep DeleteEmailTemplateResponse x)
-> (forall x.
Rep DeleteEmailTemplateResponse x -> DeleteEmailTemplateResponse)
-> Generic DeleteEmailTemplateResponse
forall x.
Rep DeleteEmailTemplateResponse x -> DeleteEmailTemplateResponse
forall x.
DeleteEmailTemplateResponse -> Rep DeleteEmailTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteEmailTemplateResponse x -> DeleteEmailTemplateResponse
$cfrom :: forall x.
DeleteEmailTemplateResponse -> Rep DeleteEmailTemplateResponse x
Prelude.Generic)
newDeleteEmailTemplateResponse ::
Prelude.Int ->
DeleteEmailTemplateResponse
newDeleteEmailTemplateResponse :: Int -> DeleteEmailTemplateResponse
newDeleteEmailTemplateResponse Int
pHttpStatus_ =
DeleteEmailTemplateResponse' :: Int -> DeleteEmailTemplateResponse
DeleteEmailTemplateResponse'
{ $sel:httpStatus:DeleteEmailTemplateResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteEmailTemplateResponse_httpStatus :: Lens.Lens' DeleteEmailTemplateResponse Prelude.Int
deleteEmailTemplateResponse_httpStatus :: (Int -> f Int)
-> DeleteEmailTemplateResponse -> f DeleteEmailTemplateResponse
deleteEmailTemplateResponse_httpStatus = (DeleteEmailTemplateResponse -> Int)
-> (DeleteEmailTemplateResponse
-> Int -> DeleteEmailTemplateResponse)
-> Lens
DeleteEmailTemplateResponse DeleteEmailTemplateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEmailTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteEmailTemplateResponse' :: DeleteEmailTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteEmailTemplateResponse
s@DeleteEmailTemplateResponse' {} Int
a -> DeleteEmailTemplateResponse
s {$sel:httpStatus:DeleteEmailTemplateResponse' :: Int
httpStatus = Int
a} :: DeleteEmailTemplateResponse)
instance Prelude.NFData DeleteEmailTemplateResponse