{-# 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.SES.VerifyEmailAddress
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deprecated. Use the @VerifyEmailIdentity@ operation to verify a new
-- email address.
module Amazonka.SES.VerifyEmailAddress
  ( -- * Creating a Request
    VerifyEmailAddress (..),
    newVerifyEmailAddress,

    -- * Request Lenses
    verifyEmailAddress_emailAddress,

    -- * Destructuring the Response
    VerifyEmailAddressResponse (..),
    newVerifyEmailAddressResponse,
  )
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

-- | Represents a request to begin email address verification with Amazon
-- SES. For information about email address verification, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html Amazon SES Developer Guide>.
--
-- /See:/ 'newVerifyEmailAddress' smart constructor.
data VerifyEmailAddress = VerifyEmailAddress'
  { -- | The email address to be verified.
    VerifyEmailAddress -> Text
emailAddress :: Prelude.Text
  }
  deriving (VerifyEmailAddress -> VerifyEmailAddress -> Bool
(VerifyEmailAddress -> VerifyEmailAddress -> Bool)
-> (VerifyEmailAddress -> VerifyEmailAddress -> Bool)
-> Eq VerifyEmailAddress
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifyEmailAddress -> VerifyEmailAddress -> Bool
$c/= :: VerifyEmailAddress -> VerifyEmailAddress -> Bool
== :: VerifyEmailAddress -> VerifyEmailAddress -> Bool
$c== :: VerifyEmailAddress -> VerifyEmailAddress -> Bool
Prelude.Eq, ReadPrec [VerifyEmailAddress]
ReadPrec VerifyEmailAddress
Int -> ReadS VerifyEmailAddress
ReadS [VerifyEmailAddress]
(Int -> ReadS VerifyEmailAddress)
-> ReadS [VerifyEmailAddress]
-> ReadPrec VerifyEmailAddress
-> ReadPrec [VerifyEmailAddress]
-> Read VerifyEmailAddress
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifyEmailAddress]
$creadListPrec :: ReadPrec [VerifyEmailAddress]
readPrec :: ReadPrec VerifyEmailAddress
$creadPrec :: ReadPrec VerifyEmailAddress
readList :: ReadS [VerifyEmailAddress]
$creadList :: ReadS [VerifyEmailAddress]
readsPrec :: Int -> ReadS VerifyEmailAddress
$creadsPrec :: Int -> ReadS VerifyEmailAddress
Prelude.Read, Int -> VerifyEmailAddress -> ShowS
[VerifyEmailAddress] -> ShowS
VerifyEmailAddress -> String
(Int -> VerifyEmailAddress -> ShowS)
-> (VerifyEmailAddress -> String)
-> ([VerifyEmailAddress] -> ShowS)
-> Show VerifyEmailAddress
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifyEmailAddress] -> ShowS
$cshowList :: [VerifyEmailAddress] -> ShowS
show :: VerifyEmailAddress -> String
$cshow :: VerifyEmailAddress -> String
showsPrec :: Int -> VerifyEmailAddress -> ShowS
$cshowsPrec :: Int -> VerifyEmailAddress -> ShowS
Prelude.Show, (forall x. VerifyEmailAddress -> Rep VerifyEmailAddress x)
-> (forall x. Rep VerifyEmailAddress x -> VerifyEmailAddress)
-> Generic VerifyEmailAddress
forall x. Rep VerifyEmailAddress x -> VerifyEmailAddress
forall x. VerifyEmailAddress -> Rep VerifyEmailAddress x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VerifyEmailAddress x -> VerifyEmailAddress
$cfrom :: forall x. VerifyEmailAddress -> Rep VerifyEmailAddress x
Prelude.Generic)

-- |
-- Create a value of 'VerifyEmailAddress' 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:
--
-- 'emailAddress', 'verifyEmailAddress_emailAddress' - The email address to be verified.
newVerifyEmailAddress ::
  -- | 'emailAddress'
  Prelude.Text ->
  VerifyEmailAddress
newVerifyEmailAddress :: Text -> VerifyEmailAddress
newVerifyEmailAddress Text
pEmailAddress_ =
  VerifyEmailAddress' :: Text -> VerifyEmailAddress
VerifyEmailAddress' {$sel:emailAddress:VerifyEmailAddress' :: Text
emailAddress = Text
pEmailAddress_}

-- | The email address to be verified.
verifyEmailAddress_emailAddress :: Lens.Lens' VerifyEmailAddress Prelude.Text
verifyEmailAddress_emailAddress :: (Text -> f Text) -> VerifyEmailAddress -> f VerifyEmailAddress
verifyEmailAddress_emailAddress = (VerifyEmailAddress -> Text)
-> (VerifyEmailAddress -> Text -> VerifyEmailAddress)
-> Lens VerifyEmailAddress VerifyEmailAddress Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifyEmailAddress' {Text
emailAddress :: Text
$sel:emailAddress:VerifyEmailAddress' :: VerifyEmailAddress -> Text
emailAddress} -> Text
emailAddress) (\s :: VerifyEmailAddress
s@VerifyEmailAddress' {} Text
a -> VerifyEmailAddress
s {$sel:emailAddress:VerifyEmailAddress' :: Text
emailAddress = Text
a} :: VerifyEmailAddress)

instance Core.AWSRequest VerifyEmailAddress where
  type
    AWSResponse VerifyEmailAddress =
      VerifyEmailAddressResponse
  request :: VerifyEmailAddress -> Request VerifyEmailAddress
request = Service -> VerifyEmailAddress -> Request VerifyEmailAddress
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy VerifyEmailAddress
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse VerifyEmailAddress)))
response =
    AWSResponse VerifyEmailAddress
-> Logger
-> Service
-> Proxy VerifyEmailAddress
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse VerifyEmailAddress)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse VerifyEmailAddress
VerifyEmailAddressResponse
VerifyEmailAddressResponse'

instance Prelude.Hashable VerifyEmailAddress

instance Prelude.NFData VerifyEmailAddress

instance Core.ToHeaders VerifyEmailAddress where
  toHeaders :: VerifyEmailAddress -> [Header]
toHeaders = [Header] -> VerifyEmailAddress -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath VerifyEmailAddress where
  toPath :: VerifyEmailAddress -> ByteString
toPath = ByteString -> VerifyEmailAddress -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery VerifyEmailAddress where
  toQuery :: VerifyEmailAddress -> QueryString
toQuery VerifyEmailAddress' {Text
emailAddress :: Text
$sel:emailAddress:VerifyEmailAddress' :: VerifyEmailAddress -> 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
"VerifyEmailAddress" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"EmailAddress" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
emailAddress
      ]

-- | /See:/ 'newVerifyEmailAddressResponse' smart constructor.
data VerifyEmailAddressResponse = VerifyEmailAddressResponse'
  {
  }
  deriving (VerifyEmailAddressResponse -> VerifyEmailAddressResponse -> Bool
(VerifyEmailAddressResponse -> VerifyEmailAddressResponse -> Bool)
-> (VerifyEmailAddressResponse
    -> VerifyEmailAddressResponse -> Bool)
-> Eq VerifyEmailAddressResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifyEmailAddressResponse -> VerifyEmailAddressResponse -> Bool
$c/= :: VerifyEmailAddressResponse -> VerifyEmailAddressResponse -> Bool
== :: VerifyEmailAddressResponse -> VerifyEmailAddressResponse -> Bool
$c== :: VerifyEmailAddressResponse -> VerifyEmailAddressResponse -> Bool
Prelude.Eq, ReadPrec [VerifyEmailAddressResponse]
ReadPrec VerifyEmailAddressResponse
Int -> ReadS VerifyEmailAddressResponse
ReadS [VerifyEmailAddressResponse]
(Int -> ReadS VerifyEmailAddressResponse)
-> ReadS [VerifyEmailAddressResponse]
-> ReadPrec VerifyEmailAddressResponse
-> ReadPrec [VerifyEmailAddressResponse]
-> Read VerifyEmailAddressResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifyEmailAddressResponse]
$creadListPrec :: ReadPrec [VerifyEmailAddressResponse]
readPrec :: ReadPrec VerifyEmailAddressResponse
$creadPrec :: ReadPrec VerifyEmailAddressResponse
readList :: ReadS [VerifyEmailAddressResponse]
$creadList :: ReadS [VerifyEmailAddressResponse]
readsPrec :: Int -> ReadS VerifyEmailAddressResponse
$creadsPrec :: Int -> ReadS VerifyEmailAddressResponse
Prelude.Read, Int -> VerifyEmailAddressResponse -> ShowS
[VerifyEmailAddressResponse] -> ShowS
VerifyEmailAddressResponse -> String
(Int -> VerifyEmailAddressResponse -> ShowS)
-> (VerifyEmailAddressResponse -> String)
-> ([VerifyEmailAddressResponse] -> ShowS)
-> Show VerifyEmailAddressResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifyEmailAddressResponse] -> ShowS
$cshowList :: [VerifyEmailAddressResponse] -> ShowS
show :: VerifyEmailAddressResponse -> String
$cshow :: VerifyEmailAddressResponse -> String
showsPrec :: Int -> VerifyEmailAddressResponse -> ShowS
$cshowsPrec :: Int -> VerifyEmailAddressResponse -> ShowS
Prelude.Show, (forall x.
 VerifyEmailAddressResponse -> Rep VerifyEmailAddressResponse x)
-> (forall x.
    Rep VerifyEmailAddressResponse x -> VerifyEmailAddressResponse)
-> Generic VerifyEmailAddressResponse
forall x.
Rep VerifyEmailAddressResponse x -> VerifyEmailAddressResponse
forall x.
VerifyEmailAddressResponse -> Rep VerifyEmailAddressResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VerifyEmailAddressResponse x -> VerifyEmailAddressResponse
$cfrom :: forall x.
VerifyEmailAddressResponse -> Rep VerifyEmailAddressResponse x
Prelude.Generic)

-- |
-- Create a value of 'VerifyEmailAddressResponse' 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.
newVerifyEmailAddressResponse ::
  VerifyEmailAddressResponse
newVerifyEmailAddressResponse :: VerifyEmailAddressResponse
newVerifyEmailAddressResponse =
  VerifyEmailAddressResponse
VerifyEmailAddressResponse'

instance Prelude.NFData VerifyEmailAddressResponse