{-# 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.ListDedicatedIpPools
-- 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)
--
-- List all of the dedicated IP pools that exist in your Amazon Pinpoint
-- account in the current AWS Region.
--
-- This operation returns paginated results.
module Amazonka.PinpointEmail.ListDedicatedIpPools
  ( -- * Creating a Request
    ListDedicatedIpPools (..),
    newListDedicatedIpPools,

    -- * Request Lenses
    listDedicatedIpPools_nextToken,
    listDedicatedIpPools_pageSize,

    -- * Destructuring the Response
    ListDedicatedIpPoolsResponse (..),
    newListDedicatedIpPoolsResponse,

    -- * Response Lenses
    listDedicatedIpPoolsResponse_dedicatedIpPools,
    listDedicatedIpPoolsResponse_nextToken,
    listDedicatedIpPoolsResponse_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 obtain a list of dedicated IP pools.
--
-- /See:/ 'newListDedicatedIpPools' smart constructor.
data ListDedicatedIpPools = ListDedicatedIpPools'
  { -- | A token returned from a previous call to @ListDedicatedIpPools@ to
    -- indicate the position in the list of dedicated IP pools.
    ListDedicatedIpPools -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of results to show in a single call to
    -- @ListDedicatedIpPools@. 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.
    ListDedicatedIpPools -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int
  }
  deriving (ListDedicatedIpPools -> ListDedicatedIpPools -> Bool
(ListDedicatedIpPools -> ListDedicatedIpPools -> Bool)
-> (ListDedicatedIpPools -> ListDedicatedIpPools -> Bool)
-> Eq ListDedicatedIpPools
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDedicatedIpPools -> ListDedicatedIpPools -> Bool
$c/= :: ListDedicatedIpPools -> ListDedicatedIpPools -> Bool
== :: ListDedicatedIpPools -> ListDedicatedIpPools -> Bool
$c== :: ListDedicatedIpPools -> ListDedicatedIpPools -> Bool
Prelude.Eq, ReadPrec [ListDedicatedIpPools]
ReadPrec ListDedicatedIpPools
Int -> ReadS ListDedicatedIpPools
ReadS [ListDedicatedIpPools]
(Int -> ReadS ListDedicatedIpPools)
-> ReadS [ListDedicatedIpPools]
-> ReadPrec ListDedicatedIpPools
-> ReadPrec [ListDedicatedIpPools]
-> Read ListDedicatedIpPools
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDedicatedIpPools]
$creadListPrec :: ReadPrec [ListDedicatedIpPools]
readPrec :: ReadPrec ListDedicatedIpPools
$creadPrec :: ReadPrec ListDedicatedIpPools
readList :: ReadS [ListDedicatedIpPools]
$creadList :: ReadS [ListDedicatedIpPools]
readsPrec :: Int -> ReadS ListDedicatedIpPools
$creadsPrec :: Int -> ReadS ListDedicatedIpPools
Prelude.Read, Int -> ListDedicatedIpPools -> ShowS
[ListDedicatedIpPools] -> ShowS
ListDedicatedIpPools -> String
(Int -> ListDedicatedIpPools -> ShowS)
-> (ListDedicatedIpPools -> String)
-> ([ListDedicatedIpPools] -> ShowS)
-> Show ListDedicatedIpPools
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDedicatedIpPools] -> ShowS
$cshowList :: [ListDedicatedIpPools] -> ShowS
show :: ListDedicatedIpPools -> String
$cshow :: ListDedicatedIpPools -> String
showsPrec :: Int -> ListDedicatedIpPools -> ShowS
$cshowsPrec :: Int -> ListDedicatedIpPools -> ShowS
Prelude.Show, (forall x. ListDedicatedIpPools -> Rep ListDedicatedIpPools x)
-> (forall x. Rep ListDedicatedIpPools x -> ListDedicatedIpPools)
-> Generic ListDedicatedIpPools
forall x. Rep ListDedicatedIpPools x -> ListDedicatedIpPools
forall x. ListDedicatedIpPools -> Rep ListDedicatedIpPools x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDedicatedIpPools x -> ListDedicatedIpPools
$cfrom :: forall x. ListDedicatedIpPools -> Rep ListDedicatedIpPools x
Prelude.Generic)

-- |
-- Create a value of 'ListDedicatedIpPools' 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', 'listDedicatedIpPools_nextToken' - A token returned from a previous call to @ListDedicatedIpPools@ to
-- indicate the position in the list of dedicated IP pools.
--
-- 'pageSize', 'listDedicatedIpPools_pageSize' - The number of results to show in a single call to
-- @ListDedicatedIpPools@. 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.
newListDedicatedIpPools ::
  ListDedicatedIpPools
newListDedicatedIpPools :: ListDedicatedIpPools
newListDedicatedIpPools =
  ListDedicatedIpPools' :: Maybe Text -> Maybe Int -> ListDedicatedIpPools
ListDedicatedIpPools'
    { $sel:nextToken:ListDedicatedIpPools' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListDedicatedIpPools' :: Maybe Int
pageSize = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The number of results to show in a single call to
-- @ListDedicatedIpPools@. 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.
listDedicatedIpPools_pageSize :: Lens.Lens' ListDedicatedIpPools (Prelude.Maybe Prelude.Int)
listDedicatedIpPools_pageSize :: (Maybe Int -> f (Maybe Int))
-> ListDedicatedIpPools -> f ListDedicatedIpPools
listDedicatedIpPools_pageSize = (ListDedicatedIpPools -> Maybe Int)
-> (ListDedicatedIpPools -> Maybe Int -> ListDedicatedIpPools)
-> Lens
     ListDedicatedIpPools ListDedicatedIpPools (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDedicatedIpPools' {Maybe Int
pageSize :: Maybe Int
$sel:pageSize:ListDedicatedIpPools' :: ListDedicatedIpPools -> Maybe Int
pageSize} -> Maybe Int
pageSize) (\s :: ListDedicatedIpPools
s@ListDedicatedIpPools' {} Maybe Int
a -> ListDedicatedIpPools
s {$sel:pageSize:ListDedicatedIpPools' :: Maybe Int
pageSize = Maybe Int
a} :: ListDedicatedIpPools)

instance Core.AWSPager ListDedicatedIpPools where
  page :: ListDedicatedIpPools
-> AWSResponse ListDedicatedIpPools -> Maybe ListDedicatedIpPools
page ListDedicatedIpPools
rq AWSResponse ListDedicatedIpPools
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDedicatedIpPools
ListDedicatedIpPoolsResponse
rs
            ListDedicatedIpPoolsResponse
-> Getting (First Text) ListDedicatedIpPoolsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDedicatedIpPoolsResponse
-> Const (First Text) ListDedicatedIpPoolsResponse
Lens' ListDedicatedIpPoolsResponse (Maybe Text)
listDedicatedIpPoolsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDedicatedIpPoolsResponse
 -> Const (First Text) ListDedicatedIpPoolsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDedicatedIpPoolsResponse 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 ListDedicatedIpPools
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDedicatedIpPools
ListDedicatedIpPoolsResponse
rs
            ListDedicatedIpPoolsResponse
-> Getting (First [Text]) ListDedicatedIpPoolsResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListDedicatedIpPoolsResponse
-> Const (First [Text]) ListDedicatedIpPoolsResponse
Lens' ListDedicatedIpPoolsResponse (Maybe [Text])
listDedicatedIpPoolsResponse_dedicatedIpPools
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListDedicatedIpPoolsResponse
 -> Const (First [Text]) ListDedicatedIpPoolsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListDedicatedIpPoolsResponse [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 ListDedicatedIpPools
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListDedicatedIpPools -> Maybe ListDedicatedIpPools
forall a. a -> Maybe a
Prelude.Just (ListDedicatedIpPools -> Maybe ListDedicatedIpPools)
-> ListDedicatedIpPools -> Maybe ListDedicatedIpPools
forall a b. (a -> b) -> a -> b
Prelude.$
        ListDedicatedIpPools
rq
          ListDedicatedIpPools
-> (ListDedicatedIpPools -> ListDedicatedIpPools)
-> ListDedicatedIpPools
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListDedicatedIpPools -> Identity ListDedicatedIpPools
Lens
  ListDedicatedIpPools ListDedicatedIpPools (Maybe Text) (Maybe Text)
listDedicatedIpPools_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListDedicatedIpPools -> Identity ListDedicatedIpPools)
-> Maybe Text -> ListDedicatedIpPools -> ListDedicatedIpPools
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDedicatedIpPools
ListDedicatedIpPoolsResponse
rs
          ListDedicatedIpPoolsResponse
-> Getting (First Text) ListDedicatedIpPoolsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDedicatedIpPoolsResponse
-> Const (First Text) ListDedicatedIpPoolsResponse
Lens' ListDedicatedIpPoolsResponse (Maybe Text)
listDedicatedIpPoolsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDedicatedIpPoolsResponse
 -> Const (First Text) ListDedicatedIpPoolsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDedicatedIpPoolsResponse 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 ListDedicatedIpPools where
  type
    AWSResponse ListDedicatedIpPools =
      ListDedicatedIpPoolsResponse
  request :: ListDedicatedIpPools -> Request ListDedicatedIpPools
request = Service -> ListDedicatedIpPools -> Request ListDedicatedIpPools
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDedicatedIpPools
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDedicatedIpPools)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDedicatedIpPools))
-> Logger
-> Service
-> Proxy ListDedicatedIpPools
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDedicatedIpPools)))
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 Text -> Int -> ListDedicatedIpPoolsResponse
ListDedicatedIpPoolsResponse'
            (Maybe [Text] -> Maybe Text -> Int -> ListDedicatedIpPoolsResponse)
-> Either String (Maybe [Text])
-> Either
     String (Maybe Text -> Int -> ListDedicatedIpPoolsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DedicatedIpPools"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Maybe Text -> Int -> ListDedicatedIpPoolsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListDedicatedIpPoolsResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> ListDedicatedIpPoolsResponse)
-> Either String Int -> Either String ListDedicatedIpPoolsResponse
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 ListDedicatedIpPools

instance Prelude.NFData ListDedicatedIpPools

instance Core.ToHeaders ListDedicatedIpPools where
  toHeaders :: ListDedicatedIpPools -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDedicatedIpPools -> 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 ListDedicatedIpPools where
  toPath :: ListDedicatedIpPools -> ByteString
toPath = ByteString -> ListDedicatedIpPools -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/email/dedicated-ip-pools"

instance Core.ToQuery ListDedicatedIpPools where
  toQuery :: ListDedicatedIpPools -> QueryString
toQuery ListDedicatedIpPools' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListDedicatedIpPools' :: ListDedicatedIpPools -> Maybe Int
$sel:nextToken:ListDedicatedIpPools' :: ListDedicatedIpPools -> 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 dedicated IP pools.
--
-- /See:/ 'newListDedicatedIpPoolsResponse' smart constructor.
data ListDedicatedIpPoolsResponse = ListDedicatedIpPoolsResponse'
  { -- | A list of all of the dedicated IP pools that are associated with your
    -- Amazon Pinpoint account.
    ListDedicatedIpPoolsResponse -> Maybe [Text]
dedicatedIpPools :: Prelude.Maybe [Prelude.Text],
    -- | A token that indicates that there are additional IP pools to list. To
    -- view additional IP pools, issue another request to
    -- @ListDedicatedIpPools@, passing this token in the @NextToken@ parameter.
    ListDedicatedIpPoolsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDedicatedIpPoolsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDedicatedIpPoolsResponse
-> ListDedicatedIpPoolsResponse -> Bool
(ListDedicatedIpPoolsResponse
 -> ListDedicatedIpPoolsResponse -> Bool)
-> (ListDedicatedIpPoolsResponse
    -> ListDedicatedIpPoolsResponse -> Bool)
-> Eq ListDedicatedIpPoolsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDedicatedIpPoolsResponse
-> ListDedicatedIpPoolsResponse -> Bool
$c/= :: ListDedicatedIpPoolsResponse
-> ListDedicatedIpPoolsResponse -> Bool
== :: ListDedicatedIpPoolsResponse
-> ListDedicatedIpPoolsResponse -> Bool
$c== :: ListDedicatedIpPoolsResponse
-> ListDedicatedIpPoolsResponse -> Bool
Prelude.Eq, ReadPrec [ListDedicatedIpPoolsResponse]
ReadPrec ListDedicatedIpPoolsResponse
Int -> ReadS ListDedicatedIpPoolsResponse
ReadS [ListDedicatedIpPoolsResponse]
(Int -> ReadS ListDedicatedIpPoolsResponse)
-> ReadS [ListDedicatedIpPoolsResponse]
-> ReadPrec ListDedicatedIpPoolsResponse
-> ReadPrec [ListDedicatedIpPoolsResponse]
-> Read ListDedicatedIpPoolsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDedicatedIpPoolsResponse]
$creadListPrec :: ReadPrec [ListDedicatedIpPoolsResponse]
readPrec :: ReadPrec ListDedicatedIpPoolsResponse
$creadPrec :: ReadPrec ListDedicatedIpPoolsResponse
readList :: ReadS [ListDedicatedIpPoolsResponse]
$creadList :: ReadS [ListDedicatedIpPoolsResponse]
readsPrec :: Int -> ReadS ListDedicatedIpPoolsResponse
$creadsPrec :: Int -> ReadS ListDedicatedIpPoolsResponse
Prelude.Read, Int -> ListDedicatedIpPoolsResponse -> ShowS
[ListDedicatedIpPoolsResponse] -> ShowS
ListDedicatedIpPoolsResponse -> String
(Int -> ListDedicatedIpPoolsResponse -> ShowS)
-> (ListDedicatedIpPoolsResponse -> String)
-> ([ListDedicatedIpPoolsResponse] -> ShowS)
-> Show ListDedicatedIpPoolsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDedicatedIpPoolsResponse] -> ShowS
$cshowList :: [ListDedicatedIpPoolsResponse] -> ShowS
show :: ListDedicatedIpPoolsResponse -> String
$cshow :: ListDedicatedIpPoolsResponse -> String
showsPrec :: Int -> ListDedicatedIpPoolsResponse -> ShowS
$cshowsPrec :: Int -> ListDedicatedIpPoolsResponse -> ShowS
Prelude.Show, (forall x.
 ListDedicatedIpPoolsResponse -> Rep ListDedicatedIpPoolsResponse x)
-> (forall x.
    Rep ListDedicatedIpPoolsResponse x -> ListDedicatedIpPoolsResponse)
-> Generic ListDedicatedIpPoolsResponse
forall x.
Rep ListDedicatedIpPoolsResponse x -> ListDedicatedIpPoolsResponse
forall x.
ListDedicatedIpPoolsResponse -> Rep ListDedicatedIpPoolsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDedicatedIpPoolsResponse x -> ListDedicatedIpPoolsResponse
$cfrom :: forall x.
ListDedicatedIpPoolsResponse -> Rep ListDedicatedIpPoolsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDedicatedIpPoolsResponse' 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:
--
-- 'dedicatedIpPools', 'listDedicatedIpPoolsResponse_dedicatedIpPools' - A list of all of the dedicated IP pools that are associated with your
-- Amazon Pinpoint account.
--
-- 'nextToken', 'listDedicatedIpPoolsResponse_nextToken' - A token that indicates that there are additional IP pools to list. To
-- view additional IP pools, issue another request to
-- @ListDedicatedIpPools@, passing this token in the @NextToken@ parameter.
--
-- 'httpStatus', 'listDedicatedIpPoolsResponse_httpStatus' - The response's http status code.
newListDedicatedIpPoolsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDedicatedIpPoolsResponse
newListDedicatedIpPoolsResponse :: Int -> ListDedicatedIpPoolsResponse
newListDedicatedIpPoolsResponse Int
pHttpStatus_ =
  ListDedicatedIpPoolsResponse' :: Maybe [Text] -> Maybe Text -> Int -> ListDedicatedIpPoolsResponse
ListDedicatedIpPoolsResponse'
    { $sel:dedicatedIpPools:ListDedicatedIpPoolsResponse' :: Maybe [Text]
dedicatedIpPools =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDedicatedIpPoolsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDedicatedIpPoolsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of all of the dedicated IP pools that are associated with your
-- Amazon Pinpoint account.
listDedicatedIpPoolsResponse_dedicatedIpPools :: Lens.Lens' ListDedicatedIpPoolsResponse (Prelude.Maybe [Prelude.Text])
listDedicatedIpPoolsResponse_dedicatedIpPools :: (Maybe [Text] -> f (Maybe [Text]))
-> ListDedicatedIpPoolsResponse -> f ListDedicatedIpPoolsResponse
listDedicatedIpPoolsResponse_dedicatedIpPools = (ListDedicatedIpPoolsResponse -> Maybe [Text])
-> (ListDedicatedIpPoolsResponse
    -> Maybe [Text] -> ListDedicatedIpPoolsResponse)
-> Lens' ListDedicatedIpPoolsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDedicatedIpPoolsResponse' {Maybe [Text]
dedicatedIpPools :: Maybe [Text]
$sel:dedicatedIpPools:ListDedicatedIpPoolsResponse' :: ListDedicatedIpPoolsResponse -> Maybe [Text]
dedicatedIpPools} -> Maybe [Text]
dedicatedIpPools) (\s :: ListDedicatedIpPoolsResponse
s@ListDedicatedIpPoolsResponse' {} Maybe [Text]
a -> ListDedicatedIpPoolsResponse
s {$sel:dedicatedIpPools:ListDedicatedIpPoolsResponse' :: Maybe [Text]
dedicatedIpPools = Maybe [Text]
a} :: ListDedicatedIpPoolsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListDedicatedIpPoolsResponse -> f ListDedicatedIpPoolsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListDedicatedIpPoolsResponse
-> f ListDedicatedIpPoolsResponse
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

-- | A token that indicates that there are additional IP pools to list. To
-- view additional IP pools, issue another request to
-- @ListDedicatedIpPools@, passing this token in the @NextToken@ parameter.
listDedicatedIpPoolsResponse_nextToken :: Lens.Lens' ListDedicatedIpPoolsResponse (Prelude.Maybe Prelude.Text)
listDedicatedIpPoolsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDedicatedIpPoolsResponse -> f ListDedicatedIpPoolsResponse
listDedicatedIpPoolsResponse_nextToken = (ListDedicatedIpPoolsResponse -> Maybe Text)
-> (ListDedicatedIpPoolsResponse
    -> Maybe Text -> ListDedicatedIpPoolsResponse)
-> Lens' ListDedicatedIpPoolsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDedicatedIpPoolsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDedicatedIpPoolsResponse' :: ListDedicatedIpPoolsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDedicatedIpPoolsResponse
s@ListDedicatedIpPoolsResponse' {} Maybe Text
a -> ListDedicatedIpPoolsResponse
s {$sel:nextToken:ListDedicatedIpPoolsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDedicatedIpPoolsResponse)

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

instance Prelude.NFData ListDedicatedIpPoolsResponse