{-# 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.PinpointEmail.ListEmailIdentities
-- 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)
--
-- Returns a list of all of the email identities that are associated with
-- your Amazon Pinpoint account. An identity can be either an email address
-- or a domain. This operation returns identities that are verified as well
-- as those that aren\'t.
--
-- This operation returns paginated results.
module Amazonka.PinpointEmail.ListEmailIdentities
  ( -- * Creating a Request
    ListEmailIdentities (..),
    newListEmailIdentities,

    -- * Request Lenses
    listEmailIdentities_nextToken,
    listEmailIdentities_pageSize,

    -- * Destructuring the Response
    ListEmailIdentitiesResponse (..),
    newListEmailIdentitiesResponse,

    -- * Response Lenses
    listEmailIdentitiesResponse_nextToken,
    listEmailIdentitiesResponse_emailIdentities,
    listEmailIdentitiesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.PinpointEmail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | A request to list all of the email identities associated with your
-- Amazon Pinpoint account. This list includes identities that you\'ve
-- already verified, identities that are unverified, and identities that
-- were verified in the past, but are no longer verified.
--
-- /See:/ 'newListEmailIdentities' smart constructor.
data ListEmailIdentities = ListEmailIdentities'
  { -- | A token returned from a previous call to @ListEmailIdentities@ to
    -- indicate the position in the list of identities.
    ListEmailIdentities -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of results to show in a single call to @ListEmailIdentities@.
    -- If the number of results is larger than the number you specified in this
    -- parameter, then the response includes a @NextToken@ element, which you
    -- can use to obtain additional results.
    --
    -- The value you specify has to be at least 0, and can be no more than
    -- 1000.
    ListEmailIdentities -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int
  }
  deriving (ListEmailIdentities -> ListEmailIdentities -> Bool
(ListEmailIdentities -> ListEmailIdentities -> Bool)
-> (ListEmailIdentities -> ListEmailIdentities -> Bool)
-> Eq ListEmailIdentities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEmailIdentities -> ListEmailIdentities -> Bool
$c/= :: ListEmailIdentities -> ListEmailIdentities -> Bool
== :: ListEmailIdentities -> ListEmailIdentities -> Bool
$c== :: ListEmailIdentities -> ListEmailIdentities -> Bool
Prelude.Eq, ReadPrec [ListEmailIdentities]
ReadPrec ListEmailIdentities
Int -> ReadS ListEmailIdentities
ReadS [ListEmailIdentities]
(Int -> ReadS ListEmailIdentities)
-> ReadS [ListEmailIdentities]
-> ReadPrec ListEmailIdentities
-> ReadPrec [ListEmailIdentities]
-> Read ListEmailIdentities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEmailIdentities]
$creadListPrec :: ReadPrec [ListEmailIdentities]
readPrec :: ReadPrec ListEmailIdentities
$creadPrec :: ReadPrec ListEmailIdentities
readList :: ReadS [ListEmailIdentities]
$creadList :: ReadS [ListEmailIdentities]
readsPrec :: Int -> ReadS ListEmailIdentities
$creadsPrec :: Int -> ReadS ListEmailIdentities
Prelude.Read, Int -> ListEmailIdentities -> ShowS
[ListEmailIdentities] -> ShowS
ListEmailIdentities -> String
(Int -> ListEmailIdentities -> ShowS)
-> (ListEmailIdentities -> String)
-> ([ListEmailIdentities] -> ShowS)
-> Show ListEmailIdentities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEmailIdentities] -> ShowS
$cshowList :: [ListEmailIdentities] -> ShowS
show :: ListEmailIdentities -> String
$cshow :: ListEmailIdentities -> String
showsPrec :: Int -> ListEmailIdentities -> ShowS
$cshowsPrec :: Int -> ListEmailIdentities -> ShowS
Prelude.Show, (forall x. ListEmailIdentities -> Rep ListEmailIdentities x)
-> (forall x. Rep ListEmailIdentities x -> ListEmailIdentities)
-> Generic ListEmailIdentities
forall x. Rep ListEmailIdentities x -> ListEmailIdentities
forall x. ListEmailIdentities -> Rep ListEmailIdentities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListEmailIdentities x -> ListEmailIdentities
$cfrom :: forall x. ListEmailIdentities -> Rep ListEmailIdentities x
Prelude.Generic)

-- |
-- Create a value of 'ListEmailIdentities' 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:
--
-- 'nextToken', 'listEmailIdentities_nextToken' - A token returned from a previous call to @ListEmailIdentities@ to
-- indicate the position in the list of identities.
--
-- 'pageSize', 'listEmailIdentities_pageSize' - The number of results to show in a single call to @ListEmailIdentities@.
-- If the number of results is larger than the number you specified in this
-- parameter, then the response includes a @NextToken@ element, which you
-- can use to obtain additional results.
--
-- The value you specify has to be at least 0, and can be no more than
-- 1000.
newListEmailIdentities ::
  ListEmailIdentities
newListEmailIdentities :: ListEmailIdentities
newListEmailIdentities =
  ListEmailIdentities' :: Maybe Text -> Maybe Int -> ListEmailIdentities
ListEmailIdentities'
    { $sel:nextToken:ListEmailIdentities' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListEmailIdentities' :: Maybe Int
pageSize = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | A token returned from a previous call to @ListEmailIdentities@ to
-- indicate the position in the list of identities.
listEmailIdentities_nextToken :: Lens.Lens' ListEmailIdentities (Prelude.Maybe Prelude.Text)
listEmailIdentities_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEmailIdentities -> f ListEmailIdentities
listEmailIdentities_nextToken = (ListEmailIdentities -> Maybe Text)
-> (ListEmailIdentities -> Maybe Text -> ListEmailIdentities)
-> Lens
     ListEmailIdentities ListEmailIdentities (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEmailIdentities' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEmailIdentities' :: ListEmailIdentities -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEmailIdentities
s@ListEmailIdentities' {} Maybe Text
a -> ListEmailIdentities
s {$sel:nextToken:ListEmailIdentities' :: Maybe Text
nextToken = Maybe Text
a} :: ListEmailIdentities)

-- | The number of results to show in a single call to @ListEmailIdentities@.
-- If the number of results is larger than the number you specified in this
-- parameter, then the response includes a @NextToken@ element, which you
-- can use to obtain additional results.
--
-- The value you specify has to be at least 0, and can be no more than
-- 1000.
listEmailIdentities_pageSize :: Lens.Lens' ListEmailIdentities (Prelude.Maybe Prelude.Int)
listEmailIdentities_pageSize :: (Maybe Int -> f (Maybe Int))
-> ListEmailIdentities -> f ListEmailIdentities
listEmailIdentities_pageSize = (ListEmailIdentities -> Maybe Int)
-> (ListEmailIdentities -> Maybe Int -> ListEmailIdentities)
-> Lens
     ListEmailIdentities ListEmailIdentities (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEmailIdentities' {Maybe Int
pageSize :: Maybe Int
$sel:pageSize:ListEmailIdentities' :: ListEmailIdentities -> Maybe Int
pageSize} -> Maybe Int
pageSize) (\s :: ListEmailIdentities
s@ListEmailIdentities' {} Maybe Int
a -> ListEmailIdentities
s {$sel:pageSize:ListEmailIdentities' :: Maybe Int
pageSize = Maybe Int
a} :: ListEmailIdentities)

instance Core.AWSPager ListEmailIdentities where
  page :: ListEmailIdentities
-> AWSResponse ListEmailIdentities -> Maybe ListEmailIdentities
page ListEmailIdentities
rq AWSResponse ListEmailIdentities
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListEmailIdentities
ListEmailIdentitiesResponse
rs
            ListEmailIdentitiesResponse
-> Getting (First Text) ListEmailIdentitiesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListEmailIdentitiesResponse
-> Const (First Text) ListEmailIdentitiesResponse
Lens' ListEmailIdentitiesResponse (Maybe Text)
listEmailIdentitiesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListEmailIdentitiesResponse
 -> Const (First Text) ListEmailIdentitiesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListEmailIdentitiesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListEmailIdentities
forall a. Maybe a
Prelude.Nothing
    | Maybe [IdentityInfo] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListEmailIdentities
ListEmailIdentitiesResponse
rs
            ListEmailIdentitiesResponse
-> Getting
     (First [IdentityInfo]) ListEmailIdentitiesResponse [IdentityInfo]
-> Maybe [IdentityInfo]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [IdentityInfo]
 -> Const (First [IdentityInfo]) (Maybe [IdentityInfo]))
-> ListEmailIdentitiesResponse
-> Const (First [IdentityInfo]) ListEmailIdentitiesResponse
Lens' ListEmailIdentitiesResponse (Maybe [IdentityInfo])
listEmailIdentitiesResponse_emailIdentities
              ((Maybe [IdentityInfo]
  -> Const (First [IdentityInfo]) (Maybe [IdentityInfo]))
 -> ListEmailIdentitiesResponse
 -> Const (First [IdentityInfo]) ListEmailIdentitiesResponse)
-> (([IdentityInfo] -> Const (First [IdentityInfo]) [IdentityInfo])
    -> Maybe [IdentityInfo]
    -> Const (First [IdentityInfo]) (Maybe [IdentityInfo]))
-> Getting
     (First [IdentityInfo]) ListEmailIdentitiesResponse [IdentityInfo]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([IdentityInfo] -> Const (First [IdentityInfo]) [IdentityInfo])
-> Maybe [IdentityInfo]
-> Const (First [IdentityInfo]) (Maybe [IdentityInfo])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListEmailIdentities
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListEmailIdentities -> Maybe ListEmailIdentities
forall a. a -> Maybe a
Prelude.Just (ListEmailIdentities -> Maybe ListEmailIdentities)
-> ListEmailIdentities -> Maybe ListEmailIdentities
forall a b. (a -> b) -> a -> b
Prelude.$
        ListEmailIdentities
rq
          ListEmailIdentities
-> (ListEmailIdentities -> ListEmailIdentities)
-> ListEmailIdentities
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListEmailIdentities -> Identity ListEmailIdentities
Lens
  ListEmailIdentities ListEmailIdentities (Maybe Text) (Maybe Text)
listEmailIdentities_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListEmailIdentities -> Identity ListEmailIdentities)
-> Maybe Text -> ListEmailIdentities -> ListEmailIdentities
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListEmailIdentities
ListEmailIdentitiesResponse
rs
          ListEmailIdentitiesResponse
-> Getting (First Text) ListEmailIdentitiesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListEmailIdentitiesResponse
-> Const (First Text) ListEmailIdentitiesResponse
Lens' ListEmailIdentitiesResponse (Maybe Text)
listEmailIdentitiesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListEmailIdentitiesResponse
 -> Const (First Text) ListEmailIdentitiesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListEmailIdentitiesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListEmailIdentities where
  type
    AWSResponse ListEmailIdentities =
      ListEmailIdentitiesResponse
  request :: ListEmailIdentities -> Request ListEmailIdentities
request = Service -> ListEmailIdentities -> Request ListEmailIdentities
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListEmailIdentities
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListEmailIdentities)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListEmailIdentities))
-> Logger
-> Service
-> Proxy ListEmailIdentities
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListEmailIdentities)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [IdentityInfo] -> Int -> ListEmailIdentitiesResponse
ListEmailIdentitiesResponse'
            (Maybe Text
 -> Maybe [IdentityInfo] -> Int -> ListEmailIdentitiesResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [IdentityInfo] -> Int -> ListEmailIdentitiesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String (Maybe [IdentityInfo] -> Int -> ListEmailIdentitiesResponse)
-> Either String (Maybe [IdentityInfo])
-> Either String (Int -> ListEmailIdentitiesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [IdentityInfo]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EmailIdentities"
                            Either String (Maybe (Maybe [IdentityInfo]))
-> Maybe [IdentityInfo] -> Either String (Maybe [IdentityInfo])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [IdentityInfo]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListEmailIdentitiesResponse)
-> Either String Int -> Either String ListEmailIdentitiesResponse
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 ListEmailIdentities

instance Prelude.NFData ListEmailIdentities

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

instance Core.ToPath ListEmailIdentities where
  toPath :: ListEmailIdentities -> ByteString
toPath = ByteString -> ListEmailIdentities -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/email/identities"

instance Core.ToQuery ListEmailIdentities where
  toQuery :: ListEmailIdentities -> QueryString
toQuery ListEmailIdentities' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListEmailIdentities' :: ListEmailIdentities -> Maybe Int
$sel:nextToken:ListEmailIdentities' :: ListEmailIdentities -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"PageSize" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
pageSize
      ]

-- | A list of all of the identities that you\'ve attempted to verify for use
-- with Amazon Pinpoint, regardless of whether or not those identities were
-- successfully verified.
--
-- /See:/ 'newListEmailIdentitiesResponse' smart constructor.
data ListEmailIdentitiesResponse = ListEmailIdentitiesResponse'
  { -- | A token that indicates that there are additional configuration sets to
    -- list. To view additional configuration sets, issue another request to
    -- @ListEmailIdentities@, and pass this token in the @NextToken@ parameter.
    ListEmailIdentitiesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array that includes all of the identities associated with your Amazon
    -- Pinpoint account.
    ListEmailIdentitiesResponse -> Maybe [IdentityInfo]
emailIdentities :: Prelude.Maybe [IdentityInfo],
    -- | The response's http status code.
    ListEmailIdentitiesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListEmailIdentitiesResponse -> ListEmailIdentitiesResponse -> Bool
(ListEmailIdentitiesResponse
 -> ListEmailIdentitiesResponse -> Bool)
-> (ListEmailIdentitiesResponse
    -> ListEmailIdentitiesResponse -> Bool)
-> Eq ListEmailIdentitiesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEmailIdentitiesResponse -> ListEmailIdentitiesResponse -> Bool
$c/= :: ListEmailIdentitiesResponse -> ListEmailIdentitiesResponse -> Bool
== :: ListEmailIdentitiesResponse -> ListEmailIdentitiesResponse -> Bool
$c== :: ListEmailIdentitiesResponse -> ListEmailIdentitiesResponse -> Bool
Prelude.Eq, ReadPrec [ListEmailIdentitiesResponse]
ReadPrec ListEmailIdentitiesResponse
Int -> ReadS ListEmailIdentitiesResponse
ReadS [ListEmailIdentitiesResponse]
(Int -> ReadS ListEmailIdentitiesResponse)
-> ReadS [ListEmailIdentitiesResponse]
-> ReadPrec ListEmailIdentitiesResponse
-> ReadPrec [ListEmailIdentitiesResponse]
-> Read ListEmailIdentitiesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEmailIdentitiesResponse]
$creadListPrec :: ReadPrec [ListEmailIdentitiesResponse]
readPrec :: ReadPrec ListEmailIdentitiesResponse
$creadPrec :: ReadPrec ListEmailIdentitiesResponse
readList :: ReadS [ListEmailIdentitiesResponse]
$creadList :: ReadS [ListEmailIdentitiesResponse]
readsPrec :: Int -> ReadS ListEmailIdentitiesResponse
$creadsPrec :: Int -> ReadS ListEmailIdentitiesResponse
Prelude.Read, Int -> ListEmailIdentitiesResponse -> ShowS
[ListEmailIdentitiesResponse] -> ShowS
ListEmailIdentitiesResponse -> String
(Int -> ListEmailIdentitiesResponse -> ShowS)
-> (ListEmailIdentitiesResponse -> String)
-> ([ListEmailIdentitiesResponse] -> ShowS)
-> Show ListEmailIdentitiesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEmailIdentitiesResponse] -> ShowS
$cshowList :: [ListEmailIdentitiesResponse] -> ShowS
show :: ListEmailIdentitiesResponse -> String
$cshow :: ListEmailIdentitiesResponse -> String
showsPrec :: Int -> ListEmailIdentitiesResponse -> ShowS
$cshowsPrec :: Int -> ListEmailIdentitiesResponse -> ShowS
Prelude.Show, (forall x.
 ListEmailIdentitiesResponse -> Rep ListEmailIdentitiesResponse x)
-> (forall x.
    Rep ListEmailIdentitiesResponse x -> ListEmailIdentitiesResponse)
-> Generic ListEmailIdentitiesResponse
forall x.
Rep ListEmailIdentitiesResponse x -> ListEmailIdentitiesResponse
forall x.
ListEmailIdentitiesResponse -> Rep ListEmailIdentitiesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEmailIdentitiesResponse x -> ListEmailIdentitiesResponse
$cfrom :: forall x.
ListEmailIdentitiesResponse -> Rep ListEmailIdentitiesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListEmailIdentitiesResponse' 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:
--
-- 'nextToken', 'listEmailIdentitiesResponse_nextToken' - A token that indicates that there are additional configuration sets to
-- list. To view additional configuration sets, issue another request to
-- @ListEmailIdentities@, and pass this token in the @NextToken@ parameter.
--
-- 'emailIdentities', 'listEmailIdentitiesResponse_emailIdentities' - An array that includes all of the identities associated with your Amazon
-- Pinpoint account.
--
-- 'httpStatus', 'listEmailIdentitiesResponse_httpStatus' - The response's http status code.
newListEmailIdentitiesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListEmailIdentitiesResponse
newListEmailIdentitiesResponse :: Int -> ListEmailIdentitiesResponse
newListEmailIdentitiesResponse Int
pHttpStatus_ =
  ListEmailIdentitiesResponse' :: Maybe Text
-> Maybe [IdentityInfo] -> Int -> ListEmailIdentitiesResponse
ListEmailIdentitiesResponse'
    { $sel:nextToken:ListEmailIdentitiesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:emailIdentities:ListEmailIdentitiesResponse' :: Maybe [IdentityInfo]
emailIdentities = Maybe [IdentityInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListEmailIdentitiesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token that indicates that there are additional configuration sets to
-- list. To view additional configuration sets, issue another request to
-- @ListEmailIdentities@, and pass this token in the @NextToken@ parameter.
listEmailIdentitiesResponse_nextToken :: Lens.Lens' ListEmailIdentitiesResponse (Prelude.Maybe Prelude.Text)
listEmailIdentitiesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEmailIdentitiesResponse -> f ListEmailIdentitiesResponse
listEmailIdentitiesResponse_nextToken = (ListEmailIdentitiesResponse -> Maybe Text)
-> (ListEmailIdentitiesResponse
    -> Maybe Text -> ListEmailIdentitiesResponse)
-> Lens' ListEmailIdentitiesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEmailIdentitiesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEmailIdentitiesResponse' :: ListEmailIdentitiesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEmailIdentitiesResponse
s@ListEmailIdentitiesResponse' {} Maybe Text
a -> ListEmailIdentitiesResponse
s {$sel:nextToken:ListEmailIdentitiesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListEmailIdentitiesResponse)

-- | An array that includes all of the identities associated with your Amazon
-- Pinpoint account.
listEmailIdentitiesResponse_emailIdentities :: Lens.Lens' ListEmailIdentitiesResponse (Prelude.Maybe [IdentityInfo])
listEmailIdentitiesResponse_emailIdentities :: (Maybe [IdentityInfo] -> f (Maybe [IdentityInfo]))
-> ListEmailIdentitiesResponse -> f ListEmailIdentitiesResponse
listEmailIdentitiesResponse_emailIdentities = (ListEmailIdentitiesResponse -> Maybe [IdentityInfo])
-> (ListEmailIdentitiesResponse
    -> Maybe [IdentityInfo] -> ListEmailIdentitiesResponse)
-> Lens' ListEmailIdentitiesResponse (Maybe [IdentityInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEmailIdentitiesResponse' {Maybe [IdentityInfo]
emailIdentities :: Maybe [IdentityInfo]
$sel:emailIdentities:ListEmailIdentitiesResponse' :: ListEmailIdentitiesResponse -> Maybe [IdentityInfo]
emailIdentities} -> Maybe [IdentityInfo]
emailIdentities) (\s :: ListEmailIdentitiesResponse
s@ListEmailIdentitiesResponse' {} Maybe [IdentityInfo]
a -> ListEmailIdentitiesResponse
s {$sel:emailIdentities:ListEmailIdentitiesResponse' :: Maybe [IdentityInfo]
emailIdentities = Maybe [IdentityInfo]
a} :: ListEmailIdentitiesResponse) ((Maybe [IdentityInfo] -> f (Maybe [IdentityInfo]))
 -> ListEmailIdentitiesResponse -> f ListEmailIdentitiesResponse)
-> ((Maybe [IdentityInfo] -> f (Maybe [IdentityInfo]))
    -> Maybe [IdentityInfo] -> f (Maybe [IdentityInfo]))
-> (Maybe [IdentityInfo] -> f (Maybe [IdentityInfo]))
-> ListEmailIdentitiesResponse
-> f ListEmailIdentitiesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [IdentityInfo] [IdentityInfo] [IdentityInfo] [IdentityInfo]
-> Iso
     (Maybe [IdentityInfo])
     (Maybe [IdentityInfo])
     (Maybe [IdentityInfo])
     (Maybe [IdentityInfo])
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 [IdentityInfo] [IdentityInfo] [IdentityInfo] [IdentityInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListEmailIdentitiesResponse