{-# 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.GetIpamPoolCidrs
-- 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 the CIDRs provisioned to an IPAM pool.
--
-- This operation returns paginated results.
module Amazonka.EC2.GetIpamPoolCidrs
  ( -- * Creating a Request
    GetIpamPoolCidrs (..),
    newGetIpamPoolCidrs,

    -- * Request Lenses
    getIpamPoolCidrs_dryRun,
    getIpamPoolCidrs_filters,
    getIpamPoolCidrs_maxResults,
    getIpamPoolCidrs_nextToken,
    getIpamPoolCidrs_ipamPoolId,

    -- * Destructuring the Response
    GetIpamPoolCidrsResponse (..),
    newGetIpamPoolCidrsResponse,

    -- * Response Lenses
    getIpamPoolCidrsResponse_ipamPoolCidrs,
    getIpamPoolCidrsResponse_nextToken,
    getIpamPoolCidrsResponse_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:/ 'newGetIpamPoolCidrs' smart constructor.
data GetIpamPoolCidrs = GetIpamPoolCidrs'
  { -- | 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@.
    GetIpamPoolCidrs -> 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>.
    GetIpamPoolCidrs -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return in the request.
    GetIpamPoolCidrs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    GetIpamPoolCidrs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the IPAM pool you want the CIDR for.
    GetIpamPoolCidrs -> Text
ipamPoolId :: Prelude.Text
  }
  deriving (GetIpamPoolCidrs -> GetIpamPoolCidrs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIpamPoolCidrs -> GetIpamPoolCidrs -> Bool
$c/= :: GetIpamPoolCidrs -> GetIpamPoolCidrs -> Bool
== :: GetIpamPoolCidrs -> GetIpamPoolCidrs -> Bool
$c== :: GetIpamPoolCidrs -> GetIpamPoolCidrs -> Bool
Prelude.Eq, ReadPrec [GetIpamPoolCidrs]
ReadPrec GetIpamPoolCidrs
Int -> ReadS GetIpamPoolCidrs
ReadS [GetIpamPoolCidrs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIpamPoolCidrs]
$creadListPrec :: ReadPrec [GetIpamPoolCidrs]
readPrec :: ReadPrec GetIpamPoolCidrs
$creadPrec :: ReadPrec GetIpamPoolCidrs
readList :: ReadS [GetIpamPoolCidrs]
$creadList :: ReadS [GetIpamPoolCidrs]
readsPrec :: Int -> ReadS GetIpamPoolCidrs
$creadsPrec :: Int -> ReadS GetIpamPoolCidrs
Prelude.Read, Int -> GetIpamPoolCidrs -> ShowS
[GetIpamPoolCidrs] -> ShowS
GetIpamPoolCidrs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIpamPoolCidrs] -> ShowS
$cshowList :: [GetIpamPoolCidrs] -> ShowS
show :: GetIpamPoolCidrs -> String
$cshow :: GetIpamPoolCidrs -> String
showsPrec :: Int -> GetIpamPoolCidrs -> ShowS
$cshowsPrec :: Int -> GetIpamPoolCidrs -> ShowS
Prelude.Show, forall x. Rep GetIpamPoolCidrs x -> GetIpamPoolCidrs
forall x. GetIpamPoolCidrs -> Rep GetIpamPoolCidrs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetIpamPoolCidrs x -> GetIpamPoolCidrs
$cfrom :: forall x. GetIpamPoolCidrs -> Rep GetIpamPoolCidrs x
Prelude.Generic)

-- |
-- Create a value of 'GetIpamPoolCidrs' 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', 'getIpamPoolCidrs_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', 'getIpamPoolCidrs_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>.
--
-- 'maxResults', 'getIpamPoolCidrs_maxResults' - The maximum number of results to return in the request.
--
-- 'nextToken', 'getIpamPoolCidrs_nextToken' - The token for the next page of results.
--
-- 'ipamPoolId', 'getIpamPoolCidrs_ipamPoolId' - The ID of the IPAM pool you want the CIDR for.
newGetIpamPoolCidrs ::
  -- | 'ipamPoolId'
  Prelude.Text ->
  GetIpamPoolCidrs
newGetIpamPoolCidrs :: Text -> GetIpamPoolCidrs
newGetIpamPoolCidrs Text
pIpamPoolId_ =
  GetIpamPoolCidrs'
    { $sel:dryRun:GetIpamPoolCidrs' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:GetIpamPoolCidrs' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetIpamPoolCidrs' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetIpamPoolCidrs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:ipamPoolId:GetIpamPoolCidrs' :: Text
ipamPoolId = Text
pIpamPoolId_
    }

-- | 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@.
getIpamPoolCidrs_dryRun :: Lens.Lens' GetIpamPoolCidrs (Prelude.Maybe Prelude.Bool)
getIpamPoolCidrs_dryRun :: Lens' GetIpamPoolCidrs (Maybe Bool)
getIpamPoolCidrs_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIpamPoolCidrs' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: GetIpamPoolCidrs
s@GetIpamPoolCidrs' {} Maybe Bool
a -> GetIpamPoolCidrs
s {$sel:dryRun:GetIpamPoolCidrs' :: Maybe Bool
dryRun = Maybe Bool
a} :: GetIpamPoolCidrs)

-- | 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>.
getIpamPoolCidrs_filters :: Lens.Lens' GetIpamPoolCidrs (Prelude.Maybe [Filter])
getIpamPoolCidrs_filters :: Lens' GetIpamPoolCidrs (Maybe [Filter])
getIpamPoolCidrs_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIpamPoolCidrs' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: GetIpamPoolCidrs
s@GetIpamPoolCidrs' {} Maybe [Filter]
a -> GetIpamPoolCidrs
s {$sel:filters:GetIpamPoolCidrs' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: GetIpamPoolCidrs) 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.
getIpamPoolCidrs_maxResults :: Lens.Lens' GetIpamPoolCidrs (Prelude.Maybe Prelude.Natural)
getIpamPoolCidrs_maxResults :: Lens' GetIpamPoolCidrs (Maybe Natural)
getIpamPoolCidrs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIpamPoolCidrs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetIpamPoolCidrs
s@GetIpamPoolCidrs' {} Maybe Natural
a -> GetIpamPoolCidrs
s {$sel:maxResults:GetIpamPoolCidrs' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetIpamPoolCidrs)

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

-- | The ID of the IPAM pool you want the CIDR for.
getIpamPoolCidrs_ipamPoolId :: Lens.Lens' GetIpamPoolCidrs Prelude.Text
getIpamPoolCidrs_ipamPoolId :: Lens' GetIpamPoolCidrs Text
getIpamPoolCidrs_ipamPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIpamPoolCidrs' {Text
ipamPoolId :: Text
$sel:ipamPoolId:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Text
ipamPoolId} -> Text
ipamPoolId) (\s :: GetIpamPoolCidrs
s@GetIpamPoolCidrs' {} Text
a -> GetIpamPoolCidrs
s {$sel:ipamPoolId:GetIpamPoolCidrs' :: Text
ipamPoolId = Text
a} :: GetIpamPoolCidrs)

instance Core.AWSPager GetIpamPoolCidrs where
  page :: GetIpamPoolCidrs
-> AWSResponse GetIpamPoolCidrs -> Maybe GetIpamPoolCidrs
page GetIpamPoolCidrs
rq AWSResponse GetIpamPoolCidrs
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetIpamPoolCidrs
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetIpamPoolCidrsResponse (Maybe Text)
getIpamPoolCidrsResponse_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 GetIpamPoolCidrs
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetIpamPoolCidrsResponse (Maybe [IpamPoolCidr])
getIpamPoolCidrsResponse_ipamPoolCidrs
            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.$ GetIpamPoolCidrs
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetIpamPoolCidrs (Maybe Text)
getIpamPoolCidrs_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetIpamPoolCidrs
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetIpamPoolCidrsResponse (Maybe Text)
getIpamPoolCidrsResponse_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 GetIpamPoolCidrs where
  type
    AWSResponse GetIpamPoolCidrs =
      GetIpamPoolCidrsResponse
  request :: (Service -> Service)
-> GetIpamPoolCidrs -> Request GetIpamPoolCidrs
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 GetIpamPoolCidrs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetIpamPoolCidrs)))
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 [IpamPoolCidr]
-> Maybe Text -> Int -> GetIpamPoolCidrsResponse
GetIpamPoolCidrsResponse'
            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
"ipamPoolCidrSet"
                            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 GetIpamPoolCidrs where
  hashWithSalt :: Int -> GetIpamPoolCidrs -> Int
hashWithSalt Int
_salt GetIpamPoolCidrs' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Text
ipamPoolId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:ipamPoolId:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Text
$sel:nextToken:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe Text
$sel:maxResults:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe Natural
$sel:filters:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe [Filter]
$sel:dryRun:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> 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 Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ipamPoolId

instance Prelude.NFData GetIpamPoolCidrs where
  rnf :: GetIpamPoolCidrs -> ()
rnf GetIpamPoolCidrs' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Text
ipamPoolId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:ipamPoolId:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Text
$sel:nextToken:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe Text
$sel:maxResults:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe Natural
$sel:filters:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe [Filter]
$sel:dryRun:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> 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 Natural
maxResults
      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 Text
ipamPoolId

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

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

instance Data.ToQuery GetIpamPoolCidrs where
  toQuery :: GetIpamPoolCidrs -> QueryString
toQuery GetIpamPoolCidrs' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Text
ipamPoolId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:ipamPoolId:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Text
$sel:nextToken:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe Text
$sel:maxResults:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe Natural
$sel:filters:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe [Filter]
$sel:dryRun:GetIpamPoolCidrs' :: GetIpamPoolCidrs -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"GetIpamPoolCidrs" :: 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),
        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,
        ByteString
"IpamPoolId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
ipamPoolId
      ]

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

-- |
-- Create a value of 'GetIpamPoolCidrsResponse' 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:
--
-- 'ipamPoolCidrs', 'getIpamPoolCidrsResponse_ipamPoolCidrs' - Information about the CIDRs provisioned to an IPAM pool.
--
-- 'nextToken', 'getIpamPoolCidrsResponse_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', 'getIpamPoolCidrsResponse_httpStatus' - The response's http status code.
newGetIpamPoolCidrsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetIpamPoolCidrsResponse
newGetIpamPoolCidrsResponse :: Int -> GetIpamPoolCidrsResponse
newGetIpamPoolCidrsResponse Int
pHttpStatus_ =
  GetIpamPoolCidrsResponse'
    { $sel:ipamPoolCidrs:GetIpamPoolCidrsResponse' :: Maybe [IpamPoolCidr]
ipamPoolCidrs =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetIpamPoolCidrsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetIpamPoolCidrsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the CIDRs provisioned to an IPAM pool.
getIpamPoolCidrsResponse_ipamPoolCidrs :: Lens.Lens' GetIpamPoolCidrsResponse (Prelude.Maybe [IpamPoolCidr])
getIpamPoolCidrsResponse_ipamPoolCidrs :: Lens' GetIpamPoolCidrsResponse (Maybe [IpamPoolCidr])
getIpamPoolCidrsResponse_ipamPoolCidrs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIpamPoolCidrsResponse' {Maybe [IpamPoolCidr]
ipamPoolCidrs :: Maybe [IpamPoolCidr]
$sel:ipamPoolCidrs:GetIpamPoolCidrsResponse' :: GetIpamPoolCidrsResponse -> Maybe [IpamPoolCidr]
ipamPoolCidrs} -> Maybe [IpamPoolCidr]
ipamPoolCidrs) (\s :: GetIpamPoolCidrsResponse
s@GetIpamPoolCidrsResponse' {} Maybe [IpamPoolCidr]
a -> GetIpamPoolCidrsResponse
s {$sel:ipamPoolCidrs:GetIpamPoolCidrsResponse' :: Maybe [IpamPoolCidr]
ipamPoolCidrs = Maybe [IpamPoolCidr]
a} :: GetIpamPoolCidrsResponse) 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.
getIpamPoolCidrsResponse_nextToken :: Lens.Lens' GetIpamPoolCidrsResponse (Prelude.Maybe Prelude.Text)
getIpamPoolCidrsResponse_nextToken :: Lens' GetIpamPoolCidrsResponse (Maybe Text)
getIpamPoolCidrsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIpamPoolCidrsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetIpamPoolCidrsResponse' :: GetIpamPoolCidrsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetIpamPoolCidrsResponse
s@GetIpamPoolCidrsResponse' {} Maybe Text
a -> GetIpamPoolCidrsResponse
s {$sel:nextToken:GetIpamPoolCidrsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetIpamPoolCidrsResponse)

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

instance Prelude.NFData GetIpamPoolCidrsResponse where
  rnf :: GetIpamPoolCidrsResponse -> ()
rnf GetIpamPoolCidrsResponse' {Int
Maybe [IpamPoolCidr]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
ipamPoolCidrs :: Maybe [IpamPoolCidr]
$sel:httpStatus:GetIpamPoolCidrsResponse' :: GetIpamPoolCidrsResponse -> Int
$sel:nextToken:GetIpamPoolCidrsResponse' :: GetIpamPoolCidrsResponse -> Maybe Text
$sel:ipamPoolCidrs:GetIpamPoolCidrsResponse' :: GetIpamPoolCidrsResponse -> Maybe [IpamPoolCidr]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [IpamPoolCidr]
ipamPoolCidrs
      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