{-# 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.EC2.DescribeIpamPools
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Get information about your IPAM pools.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeIpamPools
  ( -- * Creating a Request
    DescribeIpamPools (..),
    newDescribeIpamPools,

    -- * Request Lenses
    describeIpamPools_dryRun,
    describeIpamPools_filters,
    describeIpamPools_ipamPoolIds,
    describeIpamPools_maxResults,
    describeIpamPools_nextToken,

    -- * Destructuring the Response
    DescribeIpamPoolsResponse (..),
    newDescribeIpamPoolsResponse,

    -- * Response Lenses
    describeIpamPoolsResponse_ipamPools,
    describeIpamPoolsResponse_nextToken,
    describeIpamPoolsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeIpamPools' smart constructor.
data DescribeIpamPools = DescribeIpamPools'
  { -- | A check for whether you have the required permissions for the action
    -- without actually making the request and provides an error response. If
    -- you have the required permissions, the error response is
    -- @DryRunOperation@. Otherwise, it is @UnauthorizedOperation@.
    DescribeIpamPools -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters for the request. For more information about
    -- filtering, see
    -- <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html Filtering CLI output>.
    DescribeIpamPools -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The IDs of the IPAM pools you would like information on.
    DescribeIpamPools -> Maybe [Text]
ipamPoolIds :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of results to return in the request.
    DescribeIpamPools -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    DescribeIpamPools -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeIpamPools -> DescribeIpamPools -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeIpamPools -> DescribeIpamPools -> Bool
$c/= :: DescribeIpamPools -> DescribeIpamPools -> Bool
== :: DescribeIpamPools -> DescribeIpamPools -> Bool
$c== :: DescribeIpamPools -> DescribeIpamPools -> Bool
Prelude.Eq, ReadPrec [DescribeIpamPools]
ReadPrec DescribeIpamPools
Int -> ReadS DescribeIpamPools
ReadS [DescribeIpamPools]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeIpamPools]
$creadListPrec :: ReadPrec [DescribeIpamPools]
readPrec :: ReadPrec DescribeIpamPools
$creadPrec :: ReadPrec DescribeIpamPools
readList :: ReadS [DescribeIpamPools]
$creadList :: ReadS [DescribeIpamPools]
readsPrec :: Int -> ReadS DescribeIpamPools
$creadsPrec :: Int -> ReadS DescribeIpamPools
Prelude.Read, Int -> DescribeIpamPools -> ShowS
[DescribeIpamPools] -> ShowS
DescribeIpamPools -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeIpamPools] -> ShowS
$cshowList :: [DescribeIpamPools] -> ShowS
show :: DescribeIpamPools -> String
$cshow :: DescribeIpamPools -> String
showsPrec :: Int -> DescribeIpamPools -> ShowS
$cshowsPrec :: Int -> DescribeIpamPools -> ShowS
Prelude.Show, forall x. Rep DescribeIpamPools x -> DescribeIpamPools
forall x. DescribeIpamPools -> Rep DescribeIpamPools x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeIpamPools x -> DescribeIpamPools
$cfrom :: forall x. DescribeIpamPools -> Rep DescribeIpamPools x
Prelude.Generic)

-- |
-- Create a value of 'DescribeIpamPools' 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:
--
-- 'dryRun', 'describeIpamPools_dryRun' - A check for whether you have the required permissions for the action
-- without actually making the request and provides an error response. If
-- you have the required permissions, the error response is
-- @DryRunOperation@. Otherwise, it is @UnauthorizedOperation@.
--
-- 'filters', 'describeIpamPools_filters' - One or more filters for the request. For more information about
-- filtering, see
-- <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html Filtering CLI output>.
--
-- 'ipamPoolIds', 'describeIpamPools_ipamPoolIds' - The IDs of the IPAM pools you would like information on.
--
-- 'maxResults', 'describeIpamPools_maxResults' - The maximum number of results to return in the request.
--
-- 'nextToken', 'describeIpamPools_nextToken' - The token for the next page of results.
newDescribeIpamPools ::
  DescribeIpamPools
newDescribeIpamPools :: DescribeIpamPools
newDescribeIpamPools =
  DescribeIpamPools'
    { $sel:dryRun:DescribeIpamPools' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeIpamPools' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:ipamPoolIds:DescribeIpamPools' :: Maybe [Text]
ipamPoolIds = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeIpamPools' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeIpamPools' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | A check for whether you have the required permissions for the action
-- without actually making the request and provides an error response. If
-- you have the required permissions, the error response is
-- @DryRunOperation@. Otherwise, it is @UnauthorizedOperation@.
describeIpamPools_dryRun :: Lens.Lens' DescribeIpamPools (Prelude.Maybe Prelude.Bool)
describeIpamPools_dryRun :: Lens' DescribeIpamPools (Maybe Bool)
describeIpamPools_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpamPools' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeIpamPools' :: DescribeIpamPools -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeIpamPools
s@DescribeIpamPools' {} Maybe Bool
a -> DescribeIpamPools
s {$sel:dryRun:DescribeIpamPools' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeIpamPools)

-- | One or more filters for the request. For more information about
-- filtering, see
-- <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html Filtering CLI output>.
describeIpamPools_filters :: Lens.Lens' DescribeIpamPools (Prelude.Maybe [Filter])
describeIpamPools_filters :: Lens' DescribeIpamPools (Maybe [Filter])
describeIpamPools_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpamPools' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeIpamPools' :: DescribeIpamPools -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeIpamPools
s@DescribeIpamPools' {} Maybe [Filter]
a -> DescribeIpamPools
s {$sel:filters:DescribeIpamPools' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeIpamPools) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The IDs of the IPAM pools you would like information on.
describeIpamPools_ipamPoolIds :: Lens.Lens' DescribeIpamPools (Prelude.Maybe [Prelude.Text])
describeIpamPools_ipamPoolIds :: Lens' DescribeIpamPools (Maybe [Text])
describeIpamPools_ipamPoolIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpamPools' {Maybe [Text]
ipamPoolIds :: Maybe [Text]
$sel:ipamPoolIds:DescribeIpamPools' :: DescribeIpamPools -> Maybe [Text]
ipamPoolIds} -> Maybe [Text]
ipamPoolIds) (\s :: DescribeIpamPools
s@DescribeIpamPools' {} Maybe [Text]
a -> DescribeIpamPools
s {$sel:ipamPoolIds:DescribeIpamPools' :: Maybe [Text]
ipamPoolIds = Maybe [Text]
a} :: DescribeIpamPools) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of results to return in the request.
describeIpamPools_maxResults :: Lens.Lens' DescribeIpamPools (Prelude.Maybe Prelude.Natural)
describeIpamPools_maxResults :: Lens' DescribeIpamPools (Maybe Natural)
describeIpamPools_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpamPools' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeIpamPools' :: DescribeIpamPools -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeIpamPools
s@DescribeIpamPools' {} Maybe Natural
a -> DescribeIpamPools
s {$sel:maxResults:DescribeIpamPools' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeIpamPools)

-- | The token for the next page of results.
describeIpamPools_nextToken :: Lens.Lens' DescribeIpamPools (Prelude.Maybe Prelude.Text)
describeIpamPools_nextToken :: Lens' DescribeIpamPools (Maybe Text)
describeIpamPools_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpamPools' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeIpamPools' :: DescribeIpamPools -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeIpamPools
s@DescribeIpamPools' {} Maybe Text
a -> DescribeIpamPools
s {$sel:nextToken:DescribeIpamPools' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeIpamPools)

instance Core.AWSPager DescribeIpamPools where
  page :: DescribeIpamPools
-> AWSResponse DescribeIpamPools -> Maybe DescribeIpamPools
page DescribeIpamPools
rq AWSResponse DescribeIpamPools
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeIpamPools
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeIpamPoolsResponse (Maybe Text)
describeIpamPoolsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeIpamPools
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeIpamPoolsResponse (Maybe [IpamPool])
describeIpamPoolsResponse_ipamPools
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeIpamPools
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeIpamPools (Maybe Text)
describeIpamPools_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeIpamPools
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeIpamPoolsResponse (Maybe Text)
describeIpamPoolsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeIpamPools where
  type
    AWSResponse DescribeIpamPools =
      DescribeIpamPoolsResponse
  request :: (Service -> Service)
-> DescribeIpamPools -> Request DescribeIpamPools
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeIpamPools
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeIpamPools)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [IpamPool] -> Maybe Text -> Int -> DescribeIpamPoolsResponse
DescribeIpamPoolsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ipamPoolSet"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeIpamPools where
  hashWithSalt :: Int -> DescribeIpamPools -> Int
hashWithSalt Int
_salt DescribeIpamPools' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
ipamPoolIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeIpamPools' :: DescribeIpamPools -> Maybe Text
$sel:maxResults:DescribeIpamPools' :: DescribeIpamPools -> Maybe Natural
$sel:ipamPoolIds:DescribeIpamPools' :: DescribeIpamPools -> Maybe [Text]
$sel:filters:DescribeIpamPools' :: DescribeIpamPools -> Maybe [Filter]
$sel:dryRun:DescribeIpamPools' :: DescribeIpamPools -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
ipamPoolIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData DescribeIpamPools where
  rnf :: DescribeIpamPools -> ()
rnf DescribeIpamPools' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
ipamPoolIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeIpamPools' :: DescribeIpamPools -> Maybe Text
$sel:maxResults:DescribeIpamPools' :: DescribeIpamPools -> Maybe Natural
$sel:ipamPoolIds:DescribeIpamPools' :: DescribeIpamPools -> Maybe [Text]
$sel:filters:DescribeIpamPools' :: DescribeIpamPools -> Maybe [Filter]
$sel:dryRun:DescribeIpamPools' :: DescribeIpamPools -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
ipamPoolIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

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

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

instance Data.ToQuery DescribeIpamPools where
  toQuery :: DescribeIpamPools -> QueryString
toQuery DescribeIpamPools' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
ipamPoolIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeIpamPools' :: DescribeIpamPools -> Maybe Text
$sel:maxResults:DescribeIpamPools' :: DescribeIpamPools -> Maybe Natural
$sel:ipamPoolIds:DescribeIpamPools' :: DescribeIpamPools -> Maybe [Text]
$sel:filters:DescribeIpamPools' :: DescribeIpamPools -> Maybe [Filter]
$sel:dryRun:DescribeIpamPools' :: DescribeIpamPools -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeIpamPools" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"IpamPoolId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
ipamPoolIds
          ),
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newDescribeIpamPoolsResponse' smart constructor.
data DescribeIpamPoolsResponse = DescribeIpamPoolsResponse'
  { -- | Information about the IPAM pools.
    DescribeIpamPoolsResponse -> Maybe [IpamPool]
ipamPools :: Prelude.Maybe [IpamPool],
    -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    DescribeIpamPoolsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeIpamPoolsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeIpamPoolsResponse -> DescribeIpamPoolsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeIpamPoolsResponse -> DescribeIpamPoolsResponse -> Bool
$c/= :: DescribeIpamPoolsResponse -> DescribeIpamPoolsResponse -> Bool
== :: DescribeIpamPoolsResponse -> DescribeIpamPoolsResponse -> Bool
$c== :: DescribeIpamPoolsResponse -> DescribeIpamPoolsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeIpamPoolsResponse]
ReadPrec DescribeIpamPoolsResponse
Int -> ReadS DescribeIpamPoolsResponse
ReadS [DescribeIpamPoolsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeIpamPoolsResponse]
$creadListPrec :: ReadPrec [DescribeIpamPoolsResponse]
readPrec :: ReadPrec DescribeIpamPoolsResponse
$creadPrec :: ReadPrec DescribeIpamPoolsResponse
readList :: ReadS [DescribeIpamPoolsResponse]
$creadList :: ReadS [DescribeIpamPoolsResponse]
readsPrec :: Int -> ReadS DescribeIpamPoolsResponse
$creadsPrec :: Int -> ReadS DescribeIpamPoolsResponse
Prelude.Read, Int -> DescribeIpamPoolsResponse -> ShowS
[DescribeIpamPoolsResponse] -> ShowS
DescribeIpamPoolsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeIpamPoolsResponse] -> ShowS
$cshowList :: [DescribeIpamPoolsResponse] -> ShowS
show :: DescribeIpamPoolsResponse -> String
$cshow :: DescribeIpamPoolsResponse -> String
showsPrec :: Int -> DescribeIpamPoolsResponse -> ShowS
$cshowsPrec :: Int -> DescribeIpamPoolsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeIpamPoolsResponse x -> DescribeIpamPoolsResponse
forall x.
DescribeIpamPoolsResponse -> Rep DescribeIpamPoolsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeIpamPoolsResponse x -> DescribeIpamPoolsResponse
$cfrom :: forall x.
DescribeIpamPoolsResponse -> Rep DescribeIpamPoolsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeIpamPoolsResponse' 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:
--
-- 'ipamPools', 'describeIpamPoolsResponse_ipamPools' - Information about the IPAM pools.
--
-- 'nextToken', 'describeIpamPoolsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'describeIpamPoolsResponse_httpStatus' - The response's http status code.
newDescribeIpamPoolsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeIpamPoolsResponse
newDescribeIpamPoolsResponse :: Int -> DescribeIpamPoolsResponse
newDescribeIpamPoolsResponse Int
pHttpStatus_ =
  DescribeIpamPoolsResponse'
    { $sel:ipamPools:DescribeIpamPoolsResponse' :: Maybe [IpamPool]
ipamPools =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeIpamPoolsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeIpamPoolsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the IPAM pools.
describeIpamPoolsResponse_ipamPools :: Lens.Lens' DescribeIpamPoolsResponse (Prelude.Maybe [IpamPool])
describeIpamPoolsResponse_ipamPools :: Lens' DescribeIpamPoolsResponse (Maybe [IpamPool])
describeIpamPoolsResponse_ipamPools = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpamPoolsResponse' {Maybe [IpamPool]
ipamPools :: Maybe [IpamPool]
$sel:ipamPools:DescribeIpamPoolsResponse' :: DescribeIpamPoolsResponse -> Maybe [IpamPool]
ipamPools} -> Maybe [IpamPool]
ipamPools) (\s :: DescribeIpamPoolsResponse
s@DescribeIpamPoolsResponse' {} Maybe [IpamPool]
a -> DescribeIpamPoolsResponse
s {$sel:ipamPools:DescribeIpamPoolsResponse' :: Maybe [IpamPool]
ipamPools = Maybe [IpamPool]
a} :: DescribeIpamPoolsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
describeIpamPoolsResponse_nextToken :: Lens.Lens' DescribeIpamPoolsResponse (Prelude.Maybe Prelude.Text)
describeIpamPoolsResponse_nextToken :: Lens' DescribeIpamPoolsResponse (Maybe Text)
describeIpamPoolsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpamPoolsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeIpamPoolsResponse' :: DescribeIpamPoolsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeIpamPoolsResponse
s@DescribeIpamPoolsResponse' {} Maybe Text
a -> DescribeIpamPoolsResponse
s {$sel:nextToken:DescribeIpamPoolsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeIpamPoolsResponse)

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

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