{-# 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.GetDedicatedIps
-- 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 the dedicated IP addresses that are associated with your Amazon
-- Pinpoint account.
--
-- This operation returns paginated results.
module Amazonka.PinpointEmail.GetDedicatedIps
  ( -- * Creating a Request
    GetDedicatedIps (..),
    newGetDedicatedIps,

    -- * Request Lenses
    getDedicatedIps_poolName,
    getDedicatedIps_nextToken,
    getDedicatedIps_pageSize,

    -- * Destructuring the Response
    GetDedicatedIpsResponse (..),
    newGetDedicatedIpsResponse,

    -- * Response Lenses
    getDedicatedIpsResponse_nextToken,
    getDedicatedIpsResponse_dedicatedIps,
    getDedicatedIpsResponse_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 more information about dedicated IP pools.
--
-- /See:/ 'newGetDedicatedIps' smart constructor.
data GetDedicatedIps = GetDedicatedIps'
  { -- | The name of the IP pool that the dedicated IP address is associated
    -- with.
    GetDedicatedIps -> Maybe Text
poolName :: Prelude.Maybe Prelude.Text,
    -- | A token returned from a previous call to @GetDedicatedIps@ to indicate
    -- the position of the dedicated IP pool in the list of IP pools.
    GetDedicatedIps -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of results to show in a single call to
    -- @GetDedicatedIpsRequest@. 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.
    GetDedicatedIps -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int
  }
  deriving (GetDedicatedIps -> GetDedicatedIps -> Bool
(GetDedicatedIps -> GetDedicatedIps -> Bool)
-> (GetDedicatedIps -> GetDedicatedIps -> Bool)
-> Eq GetDedicatedIps
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDedicatedIps -> GetDedicatedIps -> Bool
$c/= :: GetDedicatedIps -> GetDedicatedIps -> Bool
== :: GetDedicatedIps -> GetDedicatedIps -> Bool
$c== :: GetDedicatedIps -> GetDedicatedIps -> Bool
Prelude.Eq, ReadPrec [GetDedicatedIps]
ReadPrec GetDedicatedIps
Int -> ReadS GetDedicatedIps
ReadS [GetDedicatedIps]
(Int -> ReadS GetDedicatedIps)
-> ReadS [GetDedicatedIps]
-> ReadPrec GetDedicatedIps
-> ReadPrec [GetDedicatedIps]
-> Read GetDedicatedIps
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDedicatedIps]
$creadListPrec :: ReadPrec [GetDedicatedIps]
readPrec :: ReadPrec GetDedicatedIps
$creadPrec :: ReadPrec GetDedicatedIps
readList :: ReadS [GetDedicatedIps]
$creadList :: ReadS [GetDedicatedIps]
readsPrec :: Int -> ReadS GetDedicatedIps
$creadsPrec :: Int -> ReadS GetDedicatedIps
Prelude.Read, Int -> GetDedicatedIps -> ShowS
[GetDedicatedIps] -> ShowS
GetDedicatedIps -> String
(Int -> GetDedicatedIps -> ShowS)
-> (GetDedicatedIps -> String)
-> ([GetDedicatedIps] -> ShowS)
-> Show GetDedicatedIps
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDedicatedIps] -> ShowS
$cshowList :: [GetDedicatedIps] -> ShowS
show :: GetDedicatedIps -> String
$cshow :: GetDedicatedIps -> String
showsPrec :: Int -> GetDedicatedIps -> ShowS
$cshowsPrec :: Int -> GetDedicatedIps -> ShowS
Prelude.Show, (forall x. GetDedicatedIps -> Rep GetDedicatedIps x)
-> (forall x. Rep GetDedicatedIps x -> GetDedicatedIps)
-> Generic GetDedicatedIps
forall x. Rep GetDedicatedIps x -> GetDedicatedIps
forall x. GetDedicatedIps -> Rep GetDedicatedIps x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDedicatedIps x -> GetDedicatedIps
$cfrom :: forall x. GetDedicatedIps -> Rep GetDedicatedIps x
Prelude.Generic)

-- |
-- Create a value of 'GetDedicatedIps' 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:
--
-- 'poolName', 'getDedicatedIps_poolName' - The name of the IP pool that the dedicated IP address is associated
-- with.
--
-- 'nextToken', 'getDedicatedIps_nextToken' - A token returned from a previous call to @GetDedicatedIps@ to indicate
-- the position of the dedicated IP pool in the list of IP pools.
--
-- 'pageSize', 'getDedicatedIps_pageSize' - The number of results to show in a single call to
-- @GetDedicatedIpsRequest@. 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.
newGetDedicatedIps ::
  GetDedicatedIps
newGetDedicatedIps :: GetDedicatedIps
newGetDedicatedIps =
  GetDedicatedIps' :: Maybe Text -> Maybe Text -> Maybe Int -> GetDedicatedIps
GetDedicatedIps'
    { $sel:poolName:GetDedicatedIps' :: Maybe Text
poolName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetDedicatedIps' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:GetDedicatedIps' :: Maybe Int
pageSize = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the IP pool that the dedicated IP address is associated
-- with.
getDedicatedIps_poolName :: Lens.Lens' GetDedicatedIps (Prelude.Maybe Prelude.Text)
getDedicatedIps_poolName :: (Maybe Text -> f (Maybe Text))
-> GetDedicatedIps -> f GetDedicatedIps
getDedicatedIps_poolName = (GetDedicatedIps -> Maybe Text)
-> (GetDedicatedIps -> Maybe Text -> GetDedicatedIps)
-> Lens GetDedicatedIps GetDedicatedIps (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDedicatedIps' {Maybe Text
poolName :: Maybe Text
$sel:poolName:GetDedicatedIps' :: GetDedicatedIps -> Maybe Text
poolName} -> Maybe Text
poolName) (\s :: GetDedicatedIps
s@GetDedicatedIps' {} Maybe Text
a -> GetDedicatedIps
s {$sel:poolName:GetDedicatedIps' :: Maybe Text
poolName = Maybe Text
a} :: GetDedicatedIps)

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

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

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

instance Prelude.NFData GetDedicatedIps

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

instance Core.ToQuery GetDedicatedIps where
  toQuery :: GetDedicatedIps -> QueryString
toQuery GetDedicatedIps' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
poolName :: Maybe Text
$sel:pageSize:GetDedicatedIps' :: GetDedicatedIps -> Maybe Int
$sel:nextToken:GetDedicatedIps' :: GetDedicatedIps -> Maybe Text
$sel:poolName:GetDedicatedIps' :: GetDedicatedIps -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"PoolName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
poolName,
        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
      ]

-- | Information about the dedicated IP addresses that are associated with
-- your Amazon Pinpoint account.
--
-- /See:/ 'newGetDedicatedIpsResponse' smart constructor.
data GetDedicatedIpsResponse = GetDedicatedIpsResponse'
  { -- | A token that indicates that there are additional dedicated IP addresses
    -- to list. To view additional addresses, issue another request to
    -- @GetDedicatedIps@, passing this token in the @NextToken@ parameter.
    GetDedicatedIpsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of dedicated IP addresses that are reserved for use by your
    -- Amazon Pinpoint account.
    GetDedicatedIpsResponse -> Maybe [DedicatedIp]
dedicatedIps :: Prelude.Maybe [DedicatedIp],
    -- | The response's http status code.
    GetDedicatedIpsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool
(GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool)
-> (GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool)
-> Eq GetDedicatedIpsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool
$c/= :: GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool
== :: GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool
$c== :: GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool
Prelude.Eq, ReadPrec [GetDedicatedIpsResponse]
ReadPrec GetDedicatedIpsResponse
Int -> ReadS GetDedicatedIpsResponse
ReadS [GetDedicatedIpsResponse]
(Int -> ReadS GetDedicatedIpsResponse)
-> ReadS [GetDedicatedIpsResponse]
-> ReadPrec GetDedicatedIpsResponse
-> ReadPrec [GetDedicatedIpsResponse]
-> Read GetDedicatedIpsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDedicatedIpsResponse]
$creadListPrec :: ReadPrec [GetDedicatedIpsResponse]
readPrec :: ReadPrec GetDedicatedIpsResponse
$creadPrec :: ReadPrec GetDedicatedIpsResponse
readList :: ReadS [GetDedicatedIpsResponse]
$creadList :: ReadS [GetDedicatedIpsResponse]
readsPrec :: Int -> ReadS GetDedicatedIpsResponse
$creadsPrec :: Int -> ReadS GetDedicatedIpsResponse
Prelude.Read, Int -> GetDedicatedIpsResponse -> ShowS
[GetDedicatedIpsResponse] -> ShowS
GetDedicatedIpsResponse -> String
(Int -> GetDedicatedIpsResponse -> ShowS)
-> (GetDedicatedIpsResponse -> String)
-> ([GetDedicatedIpsResponse] -> ShowS)
-> Show GetDedicatedIpsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDedicatedIpsResponse] -> ShowS
$cshowList :: [GetDedicatedIpsResponse] -> ShowS
show :: GetDedicatedIpsResponse -> String
$cshow :: GetDedicatedIpsResponse -> String
showsPrec :: Int -> GetDedicatedIpsResponse -> ShowS
$cshowsPrec :: Int -> GetDedicatedIpsResponse -> ShowS
Prelude.Show, (forall x.
 GetDedicatedIpsResponse -> Rep GetDedicatedIpsResponse x)
-> (forall x.
    Rep GetDedicatedIpsResponse x -> GetDedicatedIpsResponse)
-> Generic GetDedicatedIpsResponse
forall x. Rep GetDedicatedIpsResponse x -> GetDedicatedIpsResponse
forall x. GetDedicatedIpsResponse -> Rep GetDedicatedIpsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDedicatedIpsResponse x -> GetDedicatedIpsResponse
$cfrom :: forall x. GetDedicatedIpsResponse -> Rep GetDedicatedIpsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDedicatedIpsResponse' 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', 'getDedicatedIpsResponse_nextToken' - A token that indicates that there are additional dedicated IP addresses
-- to list. To view additional addresses, issue another request to
-- @GetDedicatedIps@, passing this token in the @NextToken@ parameter.
--
-- 'dedicatedIps', 'getDedicatedIpsResponse_dedicatedIps' - A list of dedicated IP addresses that are reserved for use by your
-- Amazon Pinpoint account.
--
-- 'httpStatus', 'getDedicatedIpsResponse_httpStatus' - The response's http status code.
newGetDedicatedIpsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetDedicatedIpsResponse
newGetDedicatedIpsResponse :: Int -> GetDedicatedIpsResponse
newGetDedicatedIpsResponse Int
pHttpStatus_ =
  GetDedicatedIpsResponse' :: Maybe Text -> Maybe [DedicatedIp] -> Int -> GetDedicatedIpsResponse
GetDedicatedIpsResponse'
    { $sel:nextToken:GetDedicatedIpsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dedicatedIps:GetDedicatedIpsResponse' :: Maybe [DedicatedIp]
dedicatedIps = Maybe [DedicatedIp]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetDedicatedIpsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | A list of dedicated IP addresses that are reserved for use by your
-- Amazon Pinpoint account.
getDedicatedIpsResponse_dedicatedIps :: Lens.Lens' GetDedicatedIpsResponse (Prelude.Maybe [DedicatedIp])
getDedicatedIpsResponse_dedicatedIps :: (Maybe [DedicatedIp] -> f (Maybe [DedicatedIp]))
-> GetDedicatedIpsResponse -> f GetDedicatedIpsResponse
getDedicatedIpsResponse_dedicatedIps = (GetDedicatedIpsResponse -> Maybe [DedicatedIp])
-> (GetDedicatedIpsResponse
    -> Maybe [DedicatedIp] -> GetDedicatedIpsResponse)
-> Lens' GetDedicatedIpsResponse (Maybe [DedicatedIp])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDedicatedIpsResponse' {Maybe [DedicatedIp]
dedicatedIps :: Maybe [DedicatedIp]
$sel:dedicatedIps:GetDedicatedIpsResponse' :: GetDedicatedIpsResponse -> Maybe [DedicatedIp]
dedicatedIps} -> Maybe [DedicatedIp]
dedicatedIps) (\s :: GetDedicatedIpsResponse
s@GetDedicatedIpsResponse' {} Maybe [DedicatedIp]
a -> GetDedicatedIpsResponse
s {$sel:dedicatedIps:GetDedicatedIpsResponse' :: Maybe [DedicatedIp]
dedicatedIps = Maybe [DedicatedIp]
a} :: GetDedicatedIpsResponse) ((Maybe [DedicatedIp] -> f (Maybe [DedicatedIp]))
 -> GetDedicatedIpsResponse -> f GetDedicatedIpsResponse)
-> ((Maybe [DedicatedIp] -> f (Maybe [DedicatedIp]))
    -> Maybe [DedicatedIp] -> f (Maybe [DedicatedIp]))
-> (Maybe [DedicatedIp] -> f (Maybe [DedicatedIp]))
-> GetDedicatedIpsResponse
-> f GetDedicatedIpsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DedicatedIp] [DedicatedIp] [DedicatedIp] [DedicatedIp]
-> Iso
     (Maybe [DedicatedIp])
     (Maybe [DedicatedIp])
     (Maybe [DedicatedIp])
     (Maybe [DedicatedIp])
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 [DedicatedIp] [DedicatedIp] [DedicatedIp] [DedicatedIp]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetDedicatedIpsResponse