{-# 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.ListVerifiedEmailAddresses
-- 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 @ListIdentities@ operation to list the email
-- addresses and domains associated with your account.
module Amazonka.SES.ListVerifiedEmailAddresses
  ( -- * Creating a Request
    ListVerifiedEmailAddresses (..),
    newListVerifiedEmailAddresses,

    -- * Destructuring the Response
    ListVerifiedEmailAddressesResponse (..),
    newListVerifiedEmailAddressesResponse,

    -- * Response Lenses
    listVerifiedEmailAddressesResponse_verifiedEmailAddresses,
    listVerifiedEmailAddressesResponse_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.SES.Types

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

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

instance Core.AWSRequest ListVerifiedEmailAddresses where
  type
    AWSResponse ListVerifiedEmailAddresses =
      ListVerifiedEmailAddressesResponse
  request :: (Service -> Service)
-> ListVerifiedEmailAddresses -> Request ListVerifiedEmailAddresses
request Service -> Service
overrides =
    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 ListVerifiedEmailAddresses
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListVerifiedEmailAddresses)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListVerifiedEmailAddressesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [Text] -> Int -> ListVerifiedEmailAddressesResponse
ListVerifiedEmailAddressesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"VerifiedEmailAddresses"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                        )
            forall (f :: * -> *) a b. Applicative f => 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 ListVerifiedEmailAddresses where
  hashWithSalt :: Int -> ListVerifiedEmailAddresses -> Int
hashWithSalt Int
_salt ListVerifiedEmailAddresses
_ =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()

instance Prelude.NFData ListVerifiedEmailAddresses where
  rnf :: ListVerifiedEmailAddresses -> ()
rnf ListVerifiedEmailAddresses
_ = ()

instance Data.ToHeaders ListVerifiedEmailAddresses where
  toHeaders :: ListVerifiedEmailAddresses -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance Data.ToQuery ListVerifiedEmailAddresses where
  toQuery :: ListVerifiedEmailAddresses -> QueryString
toQuery =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ ByteString
"Action"
              forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListVerifiedEmailAddresses" :: Prelude.ByteString),
            ByteString
"Version"
              forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString)
          ]
      )

-- | A list of email addresses that you have verified with Amazon SES under
-- your AWS account.
--
-- /See:/ 'newListVerifiedEmailAddressesResponse' smart constructor.
data ListVerifiedEmailAddressesResponse = ListVerifiedEmailAddressesResponse'
  { -- | A list of email addresses that have been verified.
    ListVerifiedEmailAddressesResponse -> Maybe [Text]
verifiedEmailAddresses :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListVerifiedEmailAddressesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListVerifiedEmailAddressesResponse
-> ListVerifiedEmailAddressesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVerifiedEmailAddressesResponse
-> ListVerifiedEmailAddressesResponse -> Bool
$c/= :: ListVerifiedEmailAddressesResponse
-> ListVerifiedEmailAddressesResponse -> Bool
== :: ListVerifiedEmailAddressesResponse
-> ListVerifiedEmailAddressesResponse -> Bool
$c== :: ListVerifiedEmailAddressesResponse
-> ListVerifiedEmailAddressesResponse -> Bool
Prelude.Eq, ReadPrec [ListVerifiedEmailAddressesResponse]
ReadPrec ListVerifiedEmailAddressesResponse
Int -> ReadS ListVerifiedEmailAddressesResponse
ReadS [ListVerifiedEmailAddressesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVerifiedEmailAddressesResponse]
$creadListPrec :: ReadPrec [ListVerifiedEmailAddressesResponse]
readPrec :: ReadPrec ListVerifiedEmailAddressesResponse
$creadPrec :: ReadPrec ListVerifiedEmailAddressesResponse
readList :: ReadS [ListVerifiedEmailAddressesResponse]
$creadList :: ReadS [ListVerifiedEmailAddressesResponse]
readsPrec :: Int -> ReadS ListVerifiedEmailAddressesResponse
$creadsPrec :: Int -> ReadS ListVerifiedEmailAddressesResponse
Prelude.Read, Int -> ListVerifiedEmailAddressesResponse -> ShowS
[ListVerifiedEmailAddressesResponse] -> ShowS
ListVerifiedEmailAddressesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVerifiedEmailAddressesResponse] -> ShowS
$cshowList :: [ListVerifiedEmailAddressesResponse] -> ShowS
show :: ListVerifiedEmailAddressesResponse -> String
$cshow :: ListVerifiedEmailAddressesResponse -> String
showsPrec :: Int -> ListVerifiedEmailAddressesResponse -> ShowS
$cshowsPrec :: Int -> ListVerifiedEmailAddressesResponse -> ShowS
Prelude.Show, forall x.
Rep ListVerifiedEmailAddressesResponse x
-> ListVerifiedEmailAddressesResponse
forall x.
ListVerifiedEmailAddressesResponse
-> Rep ListVerifiedEmailAddressesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVerifiedEmailAddressesResponse x
-> ListVerifiedEmailAddressesResponse
$cfrom :: forall x.
ListVerifiedEmailAddressesResponse
-> Rep ListVerifiedEmailAddressesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListVerifiedEmailAddressesResponse' 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:
--
-- 'verifiedEmailAddresses', 'listVerifiedEmailAddressesResponse_verifiedEmailAddresses' - A list of email addresses that have been verified.
--
-- 'httpStatus', 'listVerifiedEmailAddressesResponse_httpStatus' - The response's http status code.
newListVerifiedEmailAddressesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListVerifiedEmailAddressesResponse
newListVerifiedEmailAddressesResponse :: Int -> ListVerifiedEmailAddressesResponse
newListVerifiedEmailAddressesResponse Int
pHttpStatus_ =
  ListVerifiedEmailAddressesResponse'
    { $sel:verifiedEmailAddresses:ListVerifiedEmailAddressesResponse' :: Maybe [Text]
verifiedEmailAddresses =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListVerifiedEmailAddressesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of email addresses that have been verified.
listVerifiedEmailAddressesResponse_verifiedEmailAddresses :: Lens.Lens' ListVerifiedEmailAddressesResponse (Prelude.Maybe [Prelude.Text])
listVerifiedEmailAddressesResponse_verifiedEmailAddresses :: Lens' ListVerifiedEmailAddressesResponse (Maybe [Text])
listVerifiedEmailAddressesResponse_verifiedEmailAddresses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVerifiedEmailAddressesResponse' {Maybe [Text]
verifiedEmailAddresses :: Maybe [Text]
$sel:verifiedEmailAddresses:ListVerifiedEmailAddressesResponse' :: ListVerifiedEmailAddressesResponse -> Maybe [Text]
verifiedEmailAddresses} -> Maybe [Text]
verifiedEmailAddresses) (\s :: ListVerifiedEmailAddressesResponse
s@ListVerifiedEmailAddressesResponse' {} Maybe [Text]
a -> ListVerifiedEmailAddressesResponse
s {$sel:verifiedEmailAddresses:ListVerifiedEmailAddressesResponse' :: Maybe [Text]
verifiedEmailAddresses = Maybe [Text]
a} :: ListVerifiedEmailAddressesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListVerifiedEmailAddressesResponse
  where
  rnf :: ListVerifiedEmailAddressesResponse -> ()
rnf ListVerifiedEmailAddressesResponse' {Int
Maybe [Text]
httpStatus :: Int
verifiedEmailAddresses :: Maybe [Text]
$sel:httpStatus:ListVerifiedEmailAddressesResponse' :: ListVerifiedEmailAddressesResponse -> Int
$sel:verifiedEmailAddresses:ListVerifiedEmailAddressesResponse' :: ListVerifiedEmailAddressesResponse -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
verifiedEmailAddresses
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus