{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SESV2.DeleteCustomVerificationEmailTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes an existing custom verification email template.
--
-- For more information about custom verification email templates, see
-- <https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom Using custom verification email templates>
-- in the /Amazon SES Developer Guide/.
--
-- You can execute this operation no more than once per second.
module Amazonka.SESV2.DeleteCustomVerificationEmailTemplate
  ( -- * Creating a Request
    DeleteCustomVerificationEmailTemplate (..),
    newDeleteCustomVerificationEmailTemplate,

    -- * Request Lenses
    deleteCustomVerificationEmailTemplate_templateName,

    -- * Destructuring the Response
    DeleteCustomVerificationEmailTemplateResponse (..),
    newDeleteCustomVerificationEmailTemplateResponse,

    -- * Response Lenses
    deleteCustomVerificationEmailTemplateResponse_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.SESV2.Types

-- | Represents a request to delete an existing custom verification email
-- template.
--
-- /See:/ 'newDeleteCustomVerificationEmailTemplate' smart constructor.
data DeleteCustomVerificationEmailTemplate = DeleteCustomVerificationEmailTemplate'
  { -- | The name of the custom verification email template that you want to
    -- delete.
    DeleteCustomVerificationEmailTemplate -> Text
templateName :: Prelude.Text
  }
  deriving (DeleteCustomVerificationEmailTemplate
-> DeleteCustomVerificationEmailTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCustomVerificationEmailTemplate
-> DeleteCustomVerificationEmailTemplate -> Bool
$c/= :: DeleteCustomVerificationEmailTemplate
-> DeleteCustomVerificationEmailTemplate -> Bool
== :: DeleteCustomVerificationEmailTemplate
-> DeleteCustomVerificationEmailTemplate -> Bool
$c== :: DeleteCustomVerificationEmailTemplate
-> DeleteCustomVerificationEmailTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteCustomVerificationEmailTemplate]
ReadPrec DeleteCustomVerificationEmailTemplate
Int -> ReadS DeleteCustomVerificationEmailTemplate
ReadS [DeleteCustomVerificationEmailTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCustomVerificationEmailTemplate]
$creadListPrec :: ReadPrec [DeleteCustomVerificationEmailTemplate]
readPrec :: ReadPrec DeleteCustomVerificationEmailTemplate
$creadPrec :: ReadPrec DeleteCustomVerificationEmailTemplate
readList :: ReadS [DeleteCustomVerificationEmailTemplate]
$creadList :: ReadS [DeleteCustomVerificationEmailTemplate]
readsPrec :: Int -> ReadS DeleteCustomVerificationEmailTemplate
$creadsPrec :: Int -> ReadS DeleteCustomVerificationEmailTemplate
Prelude.Read, Int -> DeleteCustomVerificationEmailTemplate -> ShowS
[DeleteCustomVerificationEmailTemplate] -> ShowS
DeleteCustomVerificationEmailTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCustomVerificationEmailTemplate] -> ShowS
$cshowList :: [DeleteCustomVerificationEmailTemplate] -> ShowS
show :: DeleteCustomVerificationEmailTemplate -> String
$cshow :: DeleteCustomVerificationEmailTemplate -> String
showsPrec :: Int -> DeleteCustomVerificationEmailTemplate -> ShowS
$cshowsPrec :: Int -> DeleteCustomVerificationEmailTemplate -> ShowS
Prelude.Show, forall x.
Rep DeleteCustomVerificationEmailTemplate x
-> DeleteCustomVerificationEmailTemplate
forall x.
DeleteCustomVerificationEmailTemplate
-> Rep DeleteCustomVerificationEmailTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCustomVerificationEmailTemplate x
-> DeleteCustomVerificationEmailTemplate
$cfrom :: forall x.
DeleteCustomVerificationEmailTemplate
-> Rep DeleteCustomVerificationEmailTemplate x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCustomVerificationEmailTemplate' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'templateName', 'deleteCustomVerificationEmailTemplate_templateName' - The name of the custom verification email template that you want to
-- delete.
newDeleteCustomVerificationEmailTemplate ::
  -- | 'templateName'
  Prelude.Text ->
  DeleteCustomVerificationEmailTemplate
newDeleteCustomVerificationEmailTemplate :: Text -> DeleteCustomVerificationEmailTemplate
newDeleteCustomVerificationEmailTemplate
  Text
pTemplateName_ =
    DeleteCustomVerificationEmailTemplate'
      { $sel:templateName:DeleteCustomVerificationEmailTemplate' :: Text
templateName =
          Text
pTemplateName_
      }

-- | The name of the custom verification email template that you want to
-- delete.
deleteCustomVerificationEmailTemplate_templateName :: Lens.Lens' DeleteCustomVerificationEmailTemplate Prelude.Text
deleteCustomVerificationEmailTemplate_templateName :: Lens' DeleteCustomVerificationEmailTemplate Text
deleteCustomVerificationEmailTemplate_templateName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCustomVerificationEmailTemplate' {Text
templateName :: Text
$sel:templateName:DeleteCustomVerificationEmailTemplate' :: DeleteCustomVerificationEmailTemplate -> Text
templateName} -> Text
templateName) (\s :: DeleteCustomVerificationEmailTemplate
s@DeleteCustomVerificationEmailTemplate' {} Text
a -> DeleteCustomVerificationEmailTemplate
s {$sel:templateName:DeleteCustomVerificationEmailTemplate' :: Text
templateName = Text
a} :: DeleteCustomVerificationEmailTemplate)

instance
  Core.AWSRequest
    DeleteCustomVerificationEmailTemplate
  where
  type
    AWSResponse
      DeleteCustomVerificationEmailTemplate =
      DeleteCustomVerificationEmailTemplateResponse
  request :: (Service -> Service)
-> DeleteCustomVerificationEmailTemplate
-> Request DeleteCustomVerificationEmailTemplate
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteCustomVerificationEmailTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DeleteCustomVerificationEmailTemplate)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteCustomVerificationEmailTemplateResponse
DeleteCustomVerificationEmailTemplateResponse'
            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
    DeleteCustomVerificationEmailTemplate
  where
  hashWithSalt :: Int -> DeleteCustomVerificationEmailTemplate -> Int
hashWithSalt
    Int
_salt
    DeleteCustomVerificationEmailTemplate' {Text
templateName :: Text
$sel:templateName:DeleteCustomVerificationEmailTemplate' :: DeleteCustomVerificationEmailTemplate -> Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateName

instance
  Prelude.NFData
    DeleteCustomVerificationEmailTemplate
  where
  rnf :: DeleteCustomVerificationEmailTemplate -> ()
rnf DeleteCustomVerificationEmailTemplate' {Text
templateName :: Text
$sel:templateName:DeleteCustomVerificationEmailTemplate' :: DeleteCustomVerificationEmailTemplate -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
templateName

instance
  Data.ToHeaders
    DeleteCustomVerificationEmailTemplate
  where
  toHeaders :: DeleteCustomVerificationEmailTemplate -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToPath
    DeleteCustomVerificationEmailTemplate
  where
  toPath :: DeleteCustomVerificationEmailTemplate -> ByteString
toPath DeleteCustomVerificationEmailTemplate' {Text
templateName :: Text
$sel:templateName:DeleteCustomVerificationEmailTemplate' :: DeleteCustomVerificationEmailTemplate -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/email/custom-verification-email-templates/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
templateName
      ]

instance
  Data.ToQuery
    DeleteCustomVerificationEmailTemplate
  where
  toQuery :: DeleteCustomVerificationEmailTemplate -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | If the action is successful, the service sends back an HTTP 200 response
-- with an empty HTTP body.
--
-- /See:/ 'newDeleteCustomVerificationEmailTemplateResponse' smart constructor.
data DeleteCustomVerificationEmailTemplateResponse = DeleteCustomVerificationEmailTemplateResponse'
  { -- | The response's http status code.
    DeleteCustomVerificationEmailTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteCustomVerificationEmailTemplateResponse
-> DeleteCustomVerificationEmailTemplateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCustomVerificationEmailTemplateResponse
-> DeleteCustomVerificationEmailTemplateResponse -> Bool
$c/= :: DeleteCustomVerificationEmailTemplateResponse
-> DeleteCustomVerificationEmailTemplateResponse -> Bool
== :: DeleteCustomVerificationEmailTemplateResponse
-> DeleteCustomVerificationEmailTemplateResponse -> Bool
$c== :: DeleteCustomVerificationEmailTemplateResponse
-> DeleteCustomVerificationEmailTemplateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteCustomVerificationEmailTemplateResponse]
ReadPrec DeleteCustomVerificationEmailTemplateResponse
Int -> ReadS DeleteCustomVerificationEmailTemplateResponse
ReadS [DeleteCustomVerificationEmailTemplateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCustomVerificationEmailTemplateResponse]
$creadListPrec :: ReadPrec [DeleteCustomVerificationEmailTemplateResponse]
readPrec :: ReadPrec DeleteCustomVerificationEmailTemplateResponse
$creadPrec :: ReadPrec DeleteCustomVerificationEmailTemplateResponse
readList :: ReadS [DeleteCustomVerificationEmailTemplateResponse]
$creadList :: ReadS [DeleteCustomVerificationEmailTemplateResponse]
readsPrec :: Int -> ReadS DeleteCustomVerificationEmailTemplateResponse
$creadsPrec :: Int -> ReadS DeleteCustomVerificationEmailTemplateResponse
Prelude.Read, Int -> DeleteCustomVerificationEmailTemplateResponse -> ShowS
[DeleteCustomVerificationEmailTemplateResponse] -> ShowS
DeleteCustomVerificationEmailTemplateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCustomVerificationEmailTemplateResponse] -> ShowS
$cshowList :: [DeleteCustomVerificationEmailTemplateResponse] -> ShowS
show :: DeleteCustomVerificationEmailTemplateResponse -> String
$cshow :: DeleteCustomVerificationEmailTemplateResponse -> String
showsPrec :: Int -> DeleteCustomVerificationEmailTemplateResponse -> ShowS
$cshowsPrec :: Int -> DeleteCustomVerificationEmailTemplateResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteCustomVerificationEmailTemplateResponse x
-> DeleteCustomVerificationEmailTemplateResponse
forall x.
DeleteCustomVerificationEmailTemplateResponse
-> Rep DeleteCustomVerificationEmailTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCustomVerificationEmailTemplateResponse x
-> DeleteCustomVerificationEmailTemplateResponse
$cfrom :: forall x.
DeleteCustomVerificationEmailTemplateResponse
-> Rep DeleteCustomVerificationEmailTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCustomVerificationEmailTemplateResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'deleteCustomVerificationEmailTemplateResponse_httpStatus' - The response's http status code.
newDeleteCustomVerificationEmailTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteCustomVerificationEmailTemplateResponse
newDeleteCustomVerificationEmailTemplateResponse :: Int -> DeleteCustomVerificationEmailTemplateResponse
newDeleteCustomVerificationEmailTemplateResponse
  Int
pHttpStatus_ =
    DeleteCustomVerificationEmailTemplateResponse'
      { $sel:httpStatus:DeleteCustomVerificationEmailTemplateResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The response's http status code.
deleteCustomVerificationEmailTemplateResponse_httpStatus :: Lens.Lens' DeleteCustomVerificationEmailTemplateResponse Prelude.Int
deleteCustomVerificationEmailTemplateResponse_httpStatus :: Lens' DeleteCustomVerificationEmailTemplateResponse Int
deleteCustomVerificationEmailTemplateResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCustomVerificationEmailTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCustomVerificationEmailTemplateResponse' :: DeleteCustomVerificationEmailTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteCustomVerificationEmailTemplateResponse
s@DeleteCustomVerificationEmailTemplateResponse' {} Int
a -> DeleteCustomVerificationEmailTemplateResponse
s {$sel:httpStatus:DeleteCustomVerificationEmailTemplateResponse' :: Int
httpStatus = Int
a} :: DeleteCustomVerificationEmailTemplateResponse)

instance
  Prelude.NFData
    DeleteCustomVerificationEmailTemplateResponse
  where
  rnf :: DeleteCustomVerificationEmailTemplateResponse -> ()
rnf
    DeleteCustomVerificationEmailTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCustomVerificationEmailTemplateResponse' :: DeleteCustomVerificationEmailTemplateResponse -> Int
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus