{-# 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-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 @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.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

-- | /See:/ 'newListVerifiedEmailAddresses' smart constructor.
data ListVerifiedEmailAddresses = ListVerifiedEmailAddresses'
  {
  }
  deriving (ListVerifiedEmailAddresses -> ListVerifiedEmailAddresses -> Bool
(ListVerifiedEmailAddresses -> ListVerifiedEmailAddresses -> Bool)
-> (ListVerifiedEmailAddresses
    -> ListVerifiedEmailAddresses -> Bool)
-> Eq ListVerifiedEmailAddresses
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]
(Int -> ReadS ListVerifiedEmailAddresses)
-> ReadS [ListVerifiedEmailAddresses]
-> ReadPrec ListVerifiedEmailAddresses
-> ReadPrec [ListVerifiedEmailAddresses]
-> Read 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
(Int -> ListVerifiedEmailAddresses -> ShowS)
-> (ListVerifiedEmailAddresses -> String)
-> ([ListVerifiedEmailAddresses] -> ShowS)
-> Show ListVerifiedEmailAddresses
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.
 ListVerifiedEmailAddresses -> Rep ListVerifiedEmailAddresses x)
-> (forall x.
    Rep ListVerifiedEmailAddresses x -> ListVerifiedEmailAddresses)
-> Generic ListVerifiedEmailAddresses
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 :: ListVerifiedEmailAddresses -> Request ListVerifiedEmailAddresses
request = Service
-> ListVerifiedEmailAddresses -> Request ListVerifiedEmailAddresses
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListVerifiedEmailAddresses
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListVerifiedEmailAddresses)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListVerifiedEmailAddresses))
-> Logger
-> Service
-> Proxy ListVerifiedEmailAddresses
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListVerifiedEmailAddresses)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> 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'
            (Maybe [Text] -> Int -> ListVerifiedEmailAddressesResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> ListVerifiedEmailAddressesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VerifiedEmailAddresses"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> ListVerifiedEmailAddressesResponse)
-> Either String Int
-> Either String ListVerifiedEmailAddressesResponse
forall (f :: * -> *) a b. Applicative f => 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 ListVerifiedEmailAddresses

instance Prelude.NFData ListVerifiedEmailAddresses

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

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

instance Core.ToQuery ListVerifiedEmailAddresses where
  toQuery :: ListVerifiedEmailAddresses -> QueryString
toQuery =
    QueryString -> ListVerifiedEmailAddresses -> QueryString
forall a b. a -> b -> a
Prelude.const
      ( [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ ByteString
"Action"
              ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListVerifiedEmailAddresses" :: Prelude.ByteString),
            ByteString
"Version"
              ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (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
(ListVerifiedEmailAddressesResponse
 -> ListVerifiedEmailAddressesResponse -> Bool)
-> (ListVerifiedEmailAddressesResponse
    -> ListVerifiedEmailAddressesResponse -> Bool)
-> Eq ListVerifiedEmailAddressesResponse
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]
(Int -> ReadS ListVerifiedEmailAddressesResponse)
-> ReadS [ListVerifiedEmailAddressesResponse]
-> ReadPrec ListVerifiedEmailAddressesResponse
-> ReadPrec [ListVerifiedEmailAddressesResponse]
-> Read 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
(Int -> ListVerifiedEmailAddressesResponse -> ShowS)
-> (ListVerifiedEmailAddressesResponse -> String)
-> ([ListVerifiedEmailAddressesResponse] -> ShowS)
-> Show ListVerifiedEmailAddressesResponse
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.
 ListVerifiedEmailAddressesResponse
 -> Rep ListVerifiedEmailAddressesResponse x)
-> (forall x.
    Rep ListVerifiedEmailAddressesResponse x
    -> ListVerifiedEmailAddressesResponse)
-> Generic ListVerifiedEmailAddressesResponse
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' :: Maybe [Text] -> Int -> ListVerifiedEmailAddressesResponse
ListVerifiedEmailAddressesResponse'
    { $sel:verifiedEmailAddresses:ListVerifiedEmailAddressesResponse' :: Maybe [Text]
verifiedEmailAddresses =
        Maybe [Text]
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 :: (Maybe [Text] -> f (Maybe [Text]))
-> ListVerifiedEmailAddressesResponse
-> f ListVerifiedEmailAddressesResponse
listVerifiedEmailAddressesResponse_verifiedEmailAddresses = (ListVerifiedEmailAddressesResponse -> Maybe [Text])
-> (ListVerifiedEmailAddressesResponse
    -> Maybe [Text] -> ListVerifiedEmailAddressesResponse)
-> Lens
     ListVerifiedEmailAddressesResponse
     ListVerifiedEmailAddressesResponse
     (Maybe [Text])
     (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListVerifiedEmailAddressesResponse
 -> f ListVerifiedEmailAddressesResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListVerifiedEmailAddressesResponse
-> f ListVerifiedEmailAddressesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
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 :: (Int -> f Int)
-> ListVerifiedEmailAddressesResponse
-> f ListVerifiedEmailAddressesResponse
listVerifiedEmailAddressesResponse_httpStatus = (ListVerifiedEmailAddressesResponse -> Int)
-> (ListVerifiedEmailAddressesResponse
    -> Int -> ListVerifiedEmailAddressesResponse)
-> Lens
     ListVerifiedEmailAddressesResponse
     ListVerifiedEmailAddressesResponse
     Int
     Int
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