{-# 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.DescribeCoipPools
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes the specified customer-owned address pools or all of your
-- customer-owned address pools.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeCoipPools
  ( -- * Creating a Request
    DescribeCoipPools (..),
    newDescribeCoipPools,

    -- * Request Lenses
    describeCoipPools_dryRun,
    describeCoipPools_filters,
    describeCoipPools_maxResults,
    describeCoipPools_nextToken,
    describeCoipPools_poolIds,

    -- * Destructuring the Response
    DescribeCoipPoolsResponse (..),
    newDescribeCoipPoolsResponse,

    -- * Response Lenses
    describeCoipPoolsResponse_coipPools,
    describeCoipPoolsResponse_nextToken,
    describeCoipPoolsResponse_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:/ 'newDescribeCoipPools' smart constructor.
data DescribeCoipPools = DescribeCoipPools'
  { -- | Checks 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@.
    DescribeCoipPools -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters.
    --
    -- -   @coip-pool.local-gateway-route-table-id@ - The ID of the local
    --     gateway route table.
    --
    -- -   @coip-pool.pool-id@ - The ID of the address pool.
    DescribeCoipPools -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    DescribeCoipPools -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    DescribeCoipPools -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The IDs of the address pools.
    DescribeCoipPools -> Maybe [Text]
poolIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeCoipPools -> DescribeCoipPools -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCoipPools -> DescribeCoipPools -> Bool
$c/= :: DescribeCoipPools -> DescribeCoipPools -> Bool
== :: DescribeCoipPools -> DescribeCoipPools -> Bool
$c== :: DescribeCoipPools -> DescribeCoipPools -> Bool
Prelude.Eq, ReadPrec [DescribeCoipPools]
ReadPrec DescribeCoipPools
Int -> ReadS DescribeCoipPools
ReadS [DescribeCoipPools]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCoipPools]
$creadListPrec :: ReadPrec [DescribeCoipPools]
readPrec :: ReadPrec DescribeCoipPools
$creadPrec :: ReadPrec DescribeCoipPools
readList :: ReadS [DescribeCoipPools]
$creadList :: ReadS [DescribeCoipPools]
readsPrec :: Int -> ReadS DescribeCoipPools
$creadsPrec :: Int -> ReadS DescribeCoipPools
Prelude.Read, Int -> DescribeCoipPools -> ShowS
[DescribeCoipPools] -> ShowS
DescribeCoipPools -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCoipPools] -> ShowS
$cshowList :: [DescribeCoipPools] -> ShowS
show :: DescribeCoipPools -> String
$cshow :: DescribeCoipPools -> String
showsPrec :: Int -> DescribeCoipPools -> ShowS
$cshowsPrec :: Int -> DescribeCoipPools -> ShowS
Prelude.Show, forall x. Rep DescribeCoipPools x -> DescribeCoipPools
forall x. DescribeCoipPools -> Rep DescribeCoipPools x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeCoipPools x -> DescribeCoipPools
$cfrom :: forall x. DescribeCoipPools -> Rep DescribeCoipPools x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCoipPools' 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', 'describeCoipPools_dryRun' - Checks 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', 'describeCoipPools_filters' - One or more filters.
--
-- -   @coip-pool.local-gateway-route-table-id@ - The ID of the local
--     gateway route table.
--
-- -   @coip-pool.pool-id@ - The ID of the address pool.
--
-- 'maxResults', 'describeCoipPools_maxResults' - The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- 'nextToken', 'describeCoipPools_nextToken' - The token for the next page of results.
--
-- 'poolIds', 'describeCoipPools_poolIds' - The IDs of the address pools.
newDescribeCoipPools ::
  DescribeCoipPools
newDescribeCoipPools :: DescribeCoipPools
newDescribeCoipPools =
  DescribeCoipPools'
    { $sel:dryRun:DescribeCoipPools' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeCoipPools' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeCoipPools' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeCoipPools' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:poolIds:DescribeCoipPools' :: Maybe [Text]
poolIds = forall a. Maybe a
Prelude.Nothing
    }

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

-- | One or more filters.
--
-- -   @coip-pool.local-gateway-route-table-id@ - The ID of the local
--     gateway route table.
--
-- -   @coip-pool.pool-id@ - The ID of the address pool.
describeCoipPools_filters :: Lens.Lens' DescribeCoipPools (Prelude.Maybe [Filter])
describeCoipPools_filters :: Lens' DescribeCoipPools (Maybe [Filter])
describeCoipPools_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCoipPools' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeCoipPools' :: DescribeCoipPools -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeCoipPools
s@DescribeCoipPools' {} Maybe [Filter]
a -> DescribeCoipPools
s {$sel:filters:DescribeCoipPools' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeCoipPools) 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 with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
describeCoipPools_maxResults :: Lens.Lens' DescribeCoipPools (Prelude.Maybe Prelude.Natural)
describeCoipPools_maxResults :: Lens' DescribeCoipPools (Maybe Natural)
describeCoipPools_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCoipPools' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeCoipPools' :: DescribeCoipPools -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeCoipPools
s@DescribeCoipPools' {} Maybe Natural
a -> DescribeCoipPools
s {$sel:maxResults:DescribeCoipPools' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeCoipPools)

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

-- | The IDs of the address pools.
describeCoipPools_poolIds :: Lens.Lens' DescribeCoipPools (Prelude.Maybe [Prelude.Text])
describeCoipPools_poolIds :: Lens' DescribeCoipPools (Maybe [Text])
describeCoipPools_poolIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCoipPools' {Maybe [Text]
poolIds :: Maybe [Text]
$sel:poolIds:DescribeCoipPools' :: DescribeCoipPools -> Maybe [Text]
poolIds} -> Maybe [Text]
poolIds) (\s :: DescribeCoipPools
s@DescribeCoipPools' {} Maybe [Text]
a -> DescribeCoipPools
s {$sel:poolIds:DescribeCoipPools' :: Maybe [Text]
poolIds = Maybe [Text]
a} :: DescribeCoipPools) 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

instance Core.AWSPager DescribeCoipPools where
  page :: DescribeCoipPools
-> AWSResponse DescribeCoipPools -> Maybe DescribeCoipPools
page DescribeCoipPools
rq AWSResponse DescribeCoipPools
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeCoipPools
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCoipPoolsResponse (Maybe Text)
describeCoipPoolsResponse_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 DescribeCoipPools
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCoipPoolsResponse (Maybe [CoipPool])
describeCoipPoolsResponse_coipPools
            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.$ DescribeCoipPools
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeCoipPools (Maybe Text)
describeCoipPools_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeCoipPools
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeCoipPoolsResponse (Maybe Text)
describeCoipPoolsResponse_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 DescribeCoipPools where
  type
    AWSResponse DescribeCoipPools =
      DescribeCoipPoolsResponse
  request :: (Service -> Service)
-> DescribeCoipPools -> Request DescribeCoipPools
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 DescribeCoipPools
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCoipPools)))
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 [CoipPool] -> Maybe Text -> Int -> DescribeCoipPoolsResponse
DescribeCoipPoolsResponse'
            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
"coipPoolSet"
                            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 DescribeCoipPools where
  hashWithSalt :: Int -> DescribeCoipPools -> Int
hashWithSalt Int
_salt DescribeCoipPools' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
poolIds :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:poolIds:DescribeCoipPools' :: DescribeCoipPools -> Maybe [Text]
$sel:nextToken:DescribeCoipPools' :: DescribeCoipPools -> Maybe Text
$sel:maxResults:DescribeCoipPools' :: DescribeCoipPools -> Maybe Natural
$sel:filters:DescribeCoipPools' :: DescribeCoipPools -> Maybe [Filter]
$sel:dryRun:DescribeCoipPools' :: DescribeCoipPools -> 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` Maybe [Text]
poolIds

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

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

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

instance Data.ToQuery DescribeCoipPools where
  toQuery :: DescribeCoipPools -> QueryString
toQuery DescribeCoipPools' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
poolIds :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:poolIds:DescribeCoipPools' :: DescribeCoipPools -> Maybe [Text]
$sel:nextToken:DescribeCoipPools' :: DescribeCoipPools -> Maybe Text
$sel:maxResults:DescribeCoipPools' :: DescribeCoipPools -> Maybe Natural
$sel:filters:DescribeCoipPools' :: DescribeCoipPools -> Maybe [Filter]
$sel:dryRun:DescribeCoipPools' :: DescribeCoipPools -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeCoipPools" :: 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,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"PoolId" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
poolIds)
      ]

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

-- |
-- Create a value of 'DescribeCoipPoolsResponse' 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:
--
-- 'coipPools', 'describeCoipPoolsResponse_coipPools' - Information about the address pools.
--
-- 'nextToken', 'describeCoipPoolsResponse_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', 'describeCoipPoolsResponse_httpStatus' - The response's http status code.
newDescribeCoipPoolsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCoipPoolsResponse
newDescribeCoipPoolsResponse :: Int -> DescribeCoipPoolsResponse
newDescribeCoipPoolsResponse Int
pHttpStatus_ =
  DescribeCoipPoolsResponse'
    { $sel:coipPools:DescribeCoipPoolsResponse' :: Maybe [CoipPool]
coipPools =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeCoipPoolsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeCoipPoolsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the address pools.
describeCoipPoolsResponse_coipPools :: Lens.Lens' DescribeCoipPoolsResponse (Prelude.Maybe [CoipPool])
describeCoipPoolsResponse_coipPools :: Lens' DescribeCoipPoolsResponse (Maybe [CoipPool])
describeCoipPoolsResponse_coipPools = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCoipPoolsResponse' {Maybe [CoipPool]
coipPools :: Maybe [CoipPool]
$sel:coipPools:DescribeCoipPoolsResponse' :: DescribeCoipPoolsResponse -> Maybe [CoipPool]
coipPools} -> Maybe [CoipPool]
coipPools) (\s :: DescribeCoipPoolsResponse
s@DescribeCoipPoolsResponse' {} Maybe [CoipPool]
a -> DescribeCoipPoolsResponse
s {$sel:coipPools:DescribeCoipPoolsResponse' :: Maybe [CoipPool]
coipPools = Maybe [CoipPool]
a} :: DescribeCoipPoolsResponse) 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.
describeCoipPoolsResponse_nextToken :: Lens.Lens' DescribeCoipPoolsResponse (Prelude.Maybe Prelude.Text)
describeCoipPoolsResponse_nextToken :: Lens' DescribeCoipPoolsResponse (Maybe Text)
describeCoipPoolsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCoipPoolsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeCoipPoolsResponse' :: DescribeCoipPoolsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeCoipPoolsResponse
s@DescribeCoipPoolsResponse' {} Maybe Text
a -> DescribeCoipPoolsResponse
s {$sel:nextToken:DescribeCoipPoolsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeCoipPoolsResponse)

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

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