{-# 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.DescribePrefixLists
-- 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 available Amazon Web Services services in a prefix list
-- format, which includes the prefix list name and prefix list ID of the
-- service and the IP address range for the service.
--
-- We recommend that you use DescribeManagedPrefixLists instead.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribePrefixLists
  ( -- * Creating a Request
    DescribePrefixLists (..),
    newDescribePrefixLists,

    -- * Request Lenses
    describePrefixLists_dryRun,
    describePrefixLists_filters,
    describePrefixLists_maxResults,
    describePrefixLists_nextToken,
    describePrefixLists_prefixListIds,

    -- * Destructuring the Response
    DescribePrefixListsResponse (..),
    newDescribePrefixListsResponse,

    -- * Response Lenses
    describePrefixListsResponse_nextToken,
    describePrefixListsResponse_prefixLists,
    describePrefixListsResponse_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:/ 'newDescribePrefixLists' smart constructor.
data DescribePrefixLists = DescribePrefixLists'
  { -- | 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@.
    DescribePrefixLists -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters.
    --
    -- -   @prefix-list-id@: The ID of a prefix list.
    --
    -- -   @prefix-list-name@: The name of a prefix list.
    DescribePrefixLists -> 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.
    DescribePrefixLists -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The token for the next page of results.
    DescribePrefixLists -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | One or more prefix list IDs.
    DescribePrefixLists -> Maybe [Text]
prefixListIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribePrefixLists -> DescribePrefixLists -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePrefixLists -> DescribePrefixLists -> Bool
$c/= :: DescribePrefixLists -> DescribePrefixLists -> Bool
== :: DescribePrefixLists -> DescribePrefixLists -> Bool
$c== :: DescribePrefixLists -> DescribePrefixLists -> Bool
Prelude.Eq, ReadPrec [DescribePrefixLists]
ReadPrec DescribePrefixLists
Int -> ReadS DescribePrefixLists
ReadS [DescribePrefixLists]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePrefixLists]
$creadListPrec :: ReadPrec [DescribePrefixLists]
readPrec :: ReadPrec DescribePrefixLists
$creadPrec :: ReadPrec DescribePrefixLists
readList :: ReadS [DescribePrefixLists]
$creadList :: ReadS [DescribePrefixLists]
readsPrec :: Int -> ReadS DescribePrefixLists
$creadsPrec :: Int -> ReadS DescribePrefixLists
Prelude.Read, Int -> DescribePrefixLists -> ShowS
[DescribePrefixLists] -> ShowS
DescribePrefixLists -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePrefixLists] -> ShowS
$cshowList :: [DescribePrefixLists] -> ShowS
show :: DescribePrefixLists -> String
$cshow :: DescribePrefixLists -> String
showsPrec :: Int -> DescribePrefixLists -> ShowS
$cshowsPrec :: Int -> DescribePrefixLists -> ShowS
Prelude.Show, forall x. Rep DescribePrefixLists x -> DescribePrefixLists
forall x. DescribePrefixLists -> Rep DescribePrefixLists x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribePrefixLists x -> DescribePrefixLists
$cfrom :: forall x. DescribePrefixLists -> Rep DescribePrefixLists x
Prelude.Generic)

-- |
-- Create a value of 'DescribePrefixLists' 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', 'describePrefixLists_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', 'describePrefixLists_filters' - One or more filters.
--
-- -   @prefix-list-id@: The ID of a prefix list.
--
-- -   @prefix-list-name@: The name of a prefix list.
--
-- 'maxResults', 'describePrefixLists_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', 'describePrefixLists_nextToken' - The token for the next page of results.
--
-- 'prefixListIds', 'describePrefixLists_prefixListIds' - One or more prefix list IDs.
newDescribePrefixLists ::
  DescribePrefixLists
newDescribePrefixLists :: DescribePrefixLists
newDescribePrefixLists =
  DescribePrefixLists'
    { $sel:dryRun:DescribePrefixLists' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribePrefixLists' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribePrefixLists' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribePrefixLists' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:prefixListIds:DescribePrefixLists' :: Maybe [Text]
prefixListIds = 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@.
describePrefixLists_dryRun :: Lens.Lens' DescribePrefixLists (Prelude.Maybe Prelude.Bool)
describePrefixLists_dryRun :: Lens' DescribePrefixLists (Maybe Bool)
describePrefixLists_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrefixLists' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribePrefixLists' :: DescribePrefixLists -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribePrefixLists
s@DescribePrefixLists' {} Maybe Bool
a -> DescribePrefixLists
s {$sel:dryRun:DescribePrefixLists' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribePrefixLists)

-- | One or more filters.
--
-- -   @prefix-list-id@: The ID of a prefix list.
--
-- -   @prefix-list-name@: The name of a prefix list.
describePrefixLists_filters :: Lens.Lens' DescribePrefixLists (Prelude.Maybe [Filter])
describePrefixLists_filters :: Lens' DescribePrefixLists (Maybe [Filter])
describePrefixLists_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrefixLists' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribePrefixLists' :: DescribePrefixLists -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribePrefixLists
s@DescribePrefixLists' {} Maybe [Filter]
a -> DescribePrefixLists
s {$sel:filters:DescribePrefixLists' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribePrefixLists) 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.
describePrefixLists_maxResults :: Lens.Lens' DescribePrefixLists (Prelude.Maybe Prelude.Int)
describePrefixLists_maxResults :: Lens' DescribePrefixLists (Maybe Int)
describePrefixLists_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrefixLists' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribePrefixLists' :: DescribePrefixLists -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribePrefixLists
s@DescribePrefixLists' {} Maybe Int
a -> DescribePrefixLists
s {$sel:maxResults:DescribePrefixLists' :: Maybe Int
maxResults = Maybe Int
a} :: DescribePrefixLists)

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

-- | One or more prefix list IDs.
describePrefixLists_prefixListIds :: Lens.Lens' DescribePrefixLists (Prelude.Maybe [Prelude.Text])
describePrefixLists_prefixListIds :: Lens' DescribePrefixLists (Maybe [Text])
describePrefixLists_prefixListIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrefixLists' {Maybe [Text]
prefixListIds :: Maybe [Text]
$sel:prefixListIds:DescribePrefixLists' :: DescribePrefixLists -> Maybe [Text]
prefixListIds} -> Maybe [Text]
prefixListIds) (\s :: DescribePrefixLists
s@DescribePrefixLists' {} Maybe [Text]
a -> DescribePrefixLists
s {$sel:prefixListIds:DescribePrefixLists' :: Maybe [Text]
prefixListIds = Maybe [Text]
a} :: DescribePrefixLists) 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 DescribePrefixLists where
  page :: DescribePrefixLists
-> AWSResponse DescribePrefixLists -> Maybe DescribePrefixLists
page DescribePrefixLists
rq AWSResponse DescribePrefixLists
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribePrefixLists
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribePrefixListsResponse (Maybe Text)
describePrefixListsResponse_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 DescribePrefixLists
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribePrefixListsResponse (Maybe [PrefixList])
describePrefixListsResponse_prefixLists
            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.$ DescribePrefixLists
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribePrefixLists (Maybe Text)
describePrefixLists_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribePrefixLists
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribePrefixListsResponse (Maybe Text)
describePrefixListsResponse_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 DescribePrefixLists where
  type
    AWSResponse DescribePrefixLists =
      DescribePrefixListsResponse
  request :: (Service -> Service)
-> DescribePrefixLists -> Request DescribePrefixLists
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 DescribePrefixLists
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribePrefixLists)))
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 Text
-> Maybe [PrefixList] -> Int -> DescribePrefixListsResponse
DescribePrefixListsResponse'
            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
"nextToken")
            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
"prefixListSet"
                            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribePrefixLists where
  hashWithSalt :: Int -> DescribePrefixLists -> Int
hashWithSalt Int
_salt DescribePrefixLists' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Filter]
Maybe Text
prefixListIds :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:prefixListIds:DescribePrefixLists' :: DescribePrefixLists -> Maybe [Text]
$sel:nextToken:DescribePrefixLists' :: DescribePrefixLists -> Maybe Text
$sel:maxResults:DescribePrefixLists' :: DescribePrefixLists -> Maybe Int
$sel:filters:DescribePrefixLists' :: DescribePrefixLists -> Maybe [Filter]
$sel:dryRun:DescribePrefixLists' :: DescribePrefixLists -> 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 Int
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
prefixListIds

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

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

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

instance Data.ToQuery DescribePrefixLists where
  toQuery :: DescribePrefixLists -> QueryString
toQuery DescribePrefixLists' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Filter]
Maybe Text
prefixListIds :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:prefixListIds:DescribePrefixLists' :: DescribePrefixLists -> Maybe [Text]
$sel:nextToken:DescribePrefixLists' :: DescribePrefixLists -> Maybe Text
$sel:maxResults:DescribePrefixLists' :: DescribePrefixLists -> Maybe Int
$sel:filters:DescribePrefixLists' :: DescribePrefixLists -> Maybe [Filter]
$sel:dryRun:DescribePrefixLists' :: DescribePrefixLists -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribePrefixLists" :: 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 Int
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
"PrefixListId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
prefixListIds
          )
      ]

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

-- |
-- Create a value of 'DescribePrefixListsResponse' 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', 'describePrefixListsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'prefixLists', 'describePrefixListsResponse_prefixLists' - All available prefix lists.
--
-- 'httpStatus', 'describePrefixListsResponse_httpStatus' - The response's http status code.
newDescribePrefixListsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribePrefixListsResponse
newDescribePrefixListsResponse :: Int -> DescribePrefixListsResponse
newDescribePrefixListsResponse Int
pHttpStatus_ =
  DescribePrefixListsResponse'
    { $sel:nextToken:DescribePrefixListsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:prefixLists:DescribePrefixListsResponse' :: Maybe [PrefixList]
prefixLists = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribePrefixListsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | All available prefix lists.
describePrefixListsResponse_prefixLists :: Lens.Lens' DescribePrefixListsResponse (Prelude.Maybe [PrefixList])
describePrefixListsResponse_prefixLists :: Lens' DescribePrefixListsResponse (Maybe [PrefixList])
describePrefixListsResponse_prefixLists = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrefixListsResponse' {Maybe [PrefixList]
prefixLists :: Maybe [PrefixList]
$sel:prefixLists:DescribePrefixListsResponse' :: DescribePrefixListsResponse -> Maybe [PrefixList]
prefixLists} -> Maybe [PrefixList]
prefixLists) (\s :: DescribePrefixListsResponse
s@DescribePrefixListsResponse' {} Maybe [PrefixList]
a -> DescribePrefixListsResponse
s {$sel:prefixLists:DescribePrefixListsResponse' :: Maybe [PrefixList]
prefixLists = Maybe [PrefixList]
a} :: DescribePrefixListsResponse) 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 response's http status code.
describePrefixListsResponse_httpStatus :: Lens.Lens' DescribePrefixListsResponse Prelude.Int
describePrefixListsResponse_httpStatus :: Lens' DescribePrefixListsResponse Int
describePrefixListsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrefixListsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribePrefixListsResponse' :: DescribePrefixListsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribePrefixListsResponse
s@DescribePrefixListsResponse' {} Int
a -> DescribePrefixListsResponse
s {$sel:httpStatus:DescribePrefixListsResponse' :: Int
httpStatus = Int
a} :: DescribePrefixListsResponse)

instance Prelude.NFData DescribePrefixListsResponse where
  rnf :: DescribePrefixListsResponse -> ()
rnf DescribePrefixListsResponse' {Int
Maybe [PrefixList]
Maybe Text
httpStatus :: Int
prefixLists :: Maybe [PrefixList]
nextToken :: Maybe Text
$sel:httpStatus:DescribePrefixListsResponse' :: DescribePrefixListsResponse -> Int
$sel:prefixLists:DescribePrefixListsResponse' :: DescribePrefixListsResponse -> Maybe [PrefixList]
$sel:nextToken:DescribePrefixListsResponse' :: DescribePrefixListsResponse -> Maybe Text
..} =
    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 [PrefixList]
prefixLists
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus