{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.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

-- | 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
$c== :: VerifyEmailAddress -> VerifyEmailAddress -> Bool
== :: VerifyEmailAddress -> VerifyEmailAddress -> Bool
$c/= :: VerifyEmailAddress -> VerifyEmailAddress -> Bool
/= :: 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
$creadsPrec :: Int -> ReadS VerifyEmailAddress
readsPrec :: Int -> ReadS VerifyEmailAddress
$creadList :: ReadS [VerifyEmailAddress]
readList :: ReadS [VerifyEmailAddress]
$creadPrec :: ReadPrec VerifyEmailAddress
readPrec :: ReadPrec VerifyEmailAddress
$creadListPrec :: ReadPrec [VerifyEmailAddress]
readListPrec :: ReadPrec [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
$cshowsPrec :: Int -> VerifyEmailAddress -> ShowS
showsPrec :: Int -> VerifyEmailAddress -> ShowS
$cshow :: VerifyEmailAddress -> String
show :: VerifyEmailAddress -> String
$cshowList :: [VerifyEmailAddress] -> ShowS
showList :: [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
$cfrom :: forall x. VerifyEmailAddress -> Rep VerifyEmailAddress x
from :: forall x. VerifyEmailAddress -> Rep VerifyEmailAddress x
$cto :: forall x. Rep VerifyEmailAddress x -> VerifyEmailAddress
to :: forall x. Rep VerifyEmailAddress x -> VerifyEmailAddress
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' {$sel:emailAddress:VerifyEmailAddress' :: Text
emailAddress = Text
pEmailAddress_}

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

instance Core.AWSRequest VerifyEmailAddress where
  type
    AWSResponse VerifyEmailAddress =
      VerifyEmailAddressResponse
  request :: (Service -> Service)
-> VerifyEmailAddress -> Request VerifyEmailAddress
request Service -> Service
overrides =
    Service -> VerifyEmailAddress -> Request VerifyEmailAddress
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 VerifyEmailAddress
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse VerifyEmailAddress)))
response =
    AWSResponse VerifyEmailAddress
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy VerifyEmailAddress
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse VerifyEmailAddress)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse VerifyEmailAddress
VerifyEmailAddressResponse
VerifyEmailAddressResponse'

instance Prelude.Hashable VerifyEmailAddress where
  hashWithSalt :: Int -> VerifyEmailAddress -> Int
hashWithSalt Int
_salt VerifyEmailAddress' {Text
$sel:emailAddress:VerifyEmailAddress' :: VerifyEmailAddress -> Text
emailAddress :: Text
..} =
    Int
_salt Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
emailAddress

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

instance Data.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 Data.ToPath VerifyEmailAddress where
  toPath :: VerifyEmailAddress -> ByteString
toPath = ByteString -> VerifyEmailAddress -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery VerifyEmailAddress where
  toQuery :: VerifyEmailAddress -> QueryString
toQuery VerifyEmailAddress' {Text
$sel:emailAddress:VerifyEmailAddress' :: VerifyEmailAddress -> Text
emailAddress :: 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
"VerifyEmailAddress" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"EmailAddress" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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
$c== :: VerifyEmailAddressResponse -> VerifyEmailAddressResponse -> Bool
== :: VerifyEmailAddressResponse -> VerifyEmailAddressResponse -> Bool
$c/= :: VerifyEmailAddressResponse -> VerifyEmailAddressResponse -> Bool
/= :: 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
$creadsPrec :: Int -> ReadS VerifyEmailAddressResponse
readsPrec :: Int -> ReadS VerifyEmailAddressResponse
$creadList :: ReadS [VerifyEmailAddressResponse]
readList :: ReadS [VerifyEmailAddressResponse]
$creadPrec :: ReadPrec VerifyEmailAddressResponse
readPrec :: ReadPrec VerifyEmailAddressResponse
$creadListPrec :: ReadPrec [VerifyEmailAddressResponse]
readListPrec :: ReadPrec [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
$cshowsPrec :: Int -> VerifyEmailAddressResponse -> ShowS
showsPrec :: Int -> VerifyEmailAddressResponse -> ShowS
$cshow :: VerifyEmailAddressResponse -> String
show :: VerifyEmailAddressResponse -> String
$cshowList :: [VerifyEmailAddressResponse] -> ShowS
showList :: [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
$cfrom :: forall x.
VerifyEmailAddressResponse -> Rep VerifyEmailAddressResponse x
from :: forall x.
VerifyEmailAddressResponse -> Rep VerifyEmailAddressResponse x
$cto :: forall x.
Rep VerifyEmailAddressResponse x -> VerifyEmailAddressResponse
to :: forall x.
Rep VerifyEmailAddressResponse x -> VerifyEmailAddressResponse
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 where
  rnf :: VerifyEmailAddressResponse -> ()
rnf VerifyEmailAddressResponse
_ = ()