{-# 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.GetManagedPrefixListEntries
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets information about the entries for a specified managed prefix list.
--
-- This operation returns paginated results.
module Amazonka.EC2.GetManagedPrefixListEntries
  ( -- * Creating a Request
    GetManagedPrefixListEntries (..),
    newGetManagedPrefixListEntries,

    -- * Request Lenses
    getManagedPrefixListEntries_dryRun,
    getManagedPrefixListEntries_maxResults,
    getManagedPrefixListEntries_nextToken,
    getManagedPrefixListEntries_targetVersion,
    getManagedPrefixListEntries_prefixListId,

    -- * Destructuring the Response
    GetManagedPrefixListEntriesResponse (..),
    newGetManagedPrefixListEntriesResponse,

    -- * Response Lenses
    getManagedPrefixListEntriesResponse_entries,
    getManagedPrefixListEntriesResponse_nextToken,
    getManagedPrefixListEntriesResponse_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:/ 'newGetManagedPrefixListEntries' smart constructor.
data GetManagedPrefixListEntries = GetManagedPrefixListEntries'
  { -- | 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@.
    GetManagedPrefixListEntries -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    GetManagedPrefixListEntries -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    GetManagedPrefixListEntries -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The version of the prefix list for which to return the entries. The
    -- default is the current version.
    GetManagedPrefixListEntries -> Maybe Integer
targetVersion :: Prelude.Maybe Prelude.Integer,
    -- | The ID of the prefix list.
    GetManagedPrefixListEntries -> Text
prefixListId :: Prelude.Text
  }
  deriving (GetManagedPrefixListEntries -> GetManagedPrefixListEntries -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetManagedPrefixListEntries -> GetManagedPrefixListEntries -> Bool
$c/= :: GetManagedPrefixListEntries -> GetManagedPrefixListEntries -> Bool
== :: GetManagedPrefixListEntries -> GetManagedPrefixListEntries -> Bool
$c== :: GetManagedPrefixListEntries -> GetManagedPrefixListEntries -> Bool
Prelude.Eq, ReadPrec [GetManagedPrefixListEntries]
ReadPrec GetManagedPrefixListEntries
Int -> ReadS GetManagedPrefixListEntries
ReadS [GetManagedPrefixListEntries]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetManagedPrefixListEntries]
$creadListPrec :: ReadPrec [GetManagedPrefixListEntries]
readPrec :: ReadPrec GetManagedPrefixListEntries
$creadPrec :: ReadPrec GetManagedPrefixListEntries
readList :: ReadS [GetManagedPrefixListEntries]
$creadList :: ReadS [GetManagedPrefixListEntries]
readsPrec :: Int -> ReadS GetManagedPrefixListEntries
$creadsPrec :: Int -> ReadS GetManagedPrefixListEntries
Prelude.Read, Int -> GetManagedPrefixListEntries -> ShowS
[GetManagedPrefixListEntries] -> ShowS
GetManagedPrefixListEntries -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetManagedPrefixListEntries] -> ShowS
$cshowList :: [GetManagedPrefixListEntries] -> ShowS
show :: GetManagedPrefixListEntries -> String
$cshow :: GetManagedPrefixListEntries -> String
showsPrec :: Int -> GetManagedPrefixListEntries -> ShowS
$cshowsPrec :: Int -> GetManagedPrefixListEntries -> ShowS
Prelude.Show, forall x.
Rep GetManagedPrefixListEntries x -> GetManagedPrefixListEntries
forall x.
GetManagedPrefixListEntries -> Rep GetManagedPrefixListEntries x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetManagedPrefixListEntries x -> GetManagedPrefixListEntries
$cfrom :: forall x.
GetManagedPrefixListEntries -> Rep GetManagedPrefixListEntries x
Prelude.Generic)

-- |
-- Create a value of 'GetManagedPrefixListEntries' 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', 'getManagedPrefixListEntries_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@.
--
-- 'maxResults', 'getManagedPrefixListEntries_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', 'getManagedPrefixListEntries_nextToken' - The token for the next page of results.
--
-- 'targetVersion', 'getManagedPrefixListEntries_targetVersion' - The version of the prefix list for which to return the entries. The
-- default is the current version.
--
-- 'prefixListId', 'getManagedPrefixListEntries_prefixListId' - The ID of the prefix list.
newGetManagedPrefixListEntries ::
  -- | 'prefixListId'
  Prelude.Text ->
  GetManagedPrefixListEntries
newGetManagedPrefixListEntries :: Text -> GetManagedPrefixListEntries
newGetManagedPrefixListEntries Text
pPrefixListId_ =
  GetManagedPrefixListEntries'
    { $sel:dryRun:GetManagedPrefixListEntries' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetManagedPrefixListEntries' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetManagedPrefixListEntries' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:targetVersion:GetManagedPrefixListEntries' :: Maybe Integer
targetVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:prefixListId:GetManagedPrefixListEntries' :: Text
prefixListId = Text
pPrefixListId_
    }

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

-- | The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
getManagedPrefixListEntries_maxResults :: Lens.Lens' GetManagedPrefixListEntries (Prelude.Maybe Prelude.Natural)
getManagedPrefixListEntries_maxResults :: Lens' GetManagedPrefixListEntries (Maybe Natural)
getManagedPrefixListEntries_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedPrefixListEntries' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetManagedPrefixListEntries
s@GetManagedPrefixListEntries' {} Maybe Natural
a -> GetManagedPrefixListEntries
s {$sel:maxResults:GetManagedPrefixListEntries' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetManagedPrefixListEntries)

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

-- | The version of the prefix list for which to return the entries. The
-- default is the current version.
getManagedPrefixListEntries_targetVersion :: Lens.Lens' GetManagedPrefixListEntries (Prelude.Maybe Prelude.Integer)
getManagedPrefixListEntries_targetVersion :: Lens' GetManagedPrefixListEntries (Maybe Integer)
getManagedPrefixListEntries_targetVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedPrefixListEntries' {Maybe Integer
targetVersion :: Maybe Integer
$sel:targetVersion:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Integer
targetVersion} -> Maybe Integer
targetVersion) (\s :: GetManagedPrefixListEntries
s@GetManagedPrefixListEntries' {} Maybe Integer
a -> GetManagedPrefixListEntries
s {$sel:targetVersion:GetManagedPrefixListEntries' :: Maybe Integer
targetVersion = Maybe Integer
a} :: GetManagedPrefixListEntries)

-- | The ID of the prefix list.
getManagedPrefixListEntries_prefixListId :: Lens.Lens' GetManagedPrefixListEntries Prelude.Text
getManagedPrefixListEntries_prefixListId :: Lens' GetManagedPrefixListEntries Text
getManagedPrefixListEntries_prefixListId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedPrefixListEntries' {Text
prefixListId :: Text
$sel:prefixListId:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Text
prefixListId} -> Text
prefixListId) (\s :: GetManagedPrefixListEntries
s@GetManagedPrefixListEntries' {} Text
a -> GetManagedPrefixListEntries
s {$sel:prefixListId:GetManagedPrefixListEntries' :: Text
prefixListId = Text
a} :: GetManagedPrefixListEntries)

instance Core.AWSPager GetManagedPrefixListEntries where
  page :: GetManagedPrefixListEntries
-> AWSResponse GetManagedPrefixListEntries
-> Maybe GetManagedPrefixListEntries
page GetManagedPrefixListEntries
rq AWSResponse GetManagedPrefixListEntries
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetManagedPrefixListEntries
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetManagedPrefixListEntriesResponse (Maybe Text)
getManagedPrefixListEntriesResponse_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 GetManagedPrefixListEntries
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetManagedPrefixListEntriesResponse (Maybe [PrefixListEntry])
getManagedPrefixListEntriesResponse_entries
            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.$ GetManagedPrefixListEntries
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetManagedPrefixListEntries (Maybe Text)
getManagedPrefixListEntries_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetManagedPrefixListEntries
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetManagedPrefixListEntriesResponse (Maybe Text)
getManagedPrefixListEntriesResponse_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 GetManagedPrefixListEntries where
  type
    AWSResponse GetManagedPrefixListEntries =
      GetManagedPrefixListEntriesResponse
  request :: (Service -> Service)
-> GetManagedPrefixListEntries
-> Request GetManagedPrefixListEntries
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 GetManagedPrefixListEntries
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetManagedPrefixListEntries)))
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 [PrefixListEntry]
-> Maybe Text -> Int -> GetManagedPrefixListEntriesResponse
GetManagedPrefixListEntriesResponse'
            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
"entrySet"
                            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 GetManagedPrefixListEntries where
  hashWithSalt :: Int -> GetManagedPrefixListEntries -> Int
hashWithSalt Int
_salt GetManagedPrefixListEntries' {Maybe Bool
Maybe Integer
Maybe Natural
Maybe Text
Text
prefixListId :: Text
targetVersion :: Maybe Integer
nextToken :: Maybe Text
maxResults :: Maybe Natural
dryRun :: Maybe Bool
$sel:prefixListId:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Text
$sel:targetVersion:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Integer
$sel:nextToken:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Text
$sel:maxResults:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Natural
$sel:dryRun:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> 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 Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
targetVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
prefixListId

instance Prelude.NFData GetManagedPrefixListEntries where
  rnf :: GetManagedPrefixListEntries -> ()
rnf GetManagedPrefixListEntries' {Maybe Bool
Maybe Integer
Maybe Natural
Maybe Text
Text
prefixListId :: Text
targetVersion :: Maybe Integer
nextToken :: Maybe Text
maxResults :: Maybe Natural
dryRun :: Maybe Bool
$sel:prefixListId:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Text
$sel:targetVersion:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Integer
$sel:nextToken:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Text
$sel:maxResults:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Natural
$sel:dryRun:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> 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 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 Integer
targetVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
prefixListId

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

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

instance Data.ToQuery GetManagedPrefixListEntries where
  toQuery :: GetManagedPrefixListEntries -> QueryString
toQuery GetManagedPrefixListEntries' {Maybe Bool
Maybe Integer
Maybe Natural
Maybe Text
Text
prefixListId :: Text
targetVersion :: Maybe Integer
nextToken :: Maybe Text
maxResults :: Maybe Natural
dryRun :: Maybe Bool
$sel:prefixListId:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Text
$sel:targetVersion:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Integer
$sel:nextToken:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Text
$sel:maxResults:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Natural
$sel:dryRun:GetManagedPrefixListEntries' :: GetManagedPrefixListEntries -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"GetManagedPrefixListEntries" ::
                      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,
        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
"TargetVersion" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Integer
targetVersion,
        ByteString
"PrefixListId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
prefixListId
      ]

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

-- |
-- Create a value of 'GetManagedPrefixListEntriesResponse' 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:
--
-- 'entries', 'getManagedPrefixListEntriesResponse_entries' - Information about the prefix list entries.
--
-- 'nextToken', 'getManagedPrefixListEntriesResponse_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', 'getManagedPrefixListEntriesResponse_httpStatus' - The response's http status code.
newGetManagedPrefixListEntriesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetManagedPrefixListEntriesResponse
newGetManagedPrefixListEntriesResponse :: Int -> GetManagedPrefixListEntriesResponse
newGetManagedPrefixListEntriesResponse Int
pHttpStatus_ =
  GetManagedPrefixListEntriesResponse'
    { $sel:entries:GetManagedPrefixListEntriesResponse' :: Maybe [PrefixListEntry]
entries =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetManagedPrefixListEntriesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetManagedPrefixListEntriesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the prefix list entries.
getManagedPrefixListEntriesResponse_entries :: Lens.Lens' GetManagedPrefixListEntriesResponse (Prelude.Maybe [PrefixListEntry])
getManagedPrefixListEntriesResponse_entries :: Lens' GetManagedPrefixListEntriesResponse (Maybe [PrefixListEntry])
getManagedPrefixListEntriesResponse_entries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedPrefixListEntriesResponse' {Maybe [PrefixListEntry]
entries :: Maybe [PrefixListEntry]
$sel:entries:GetManagedPrefixListEntriesResponse' :: GetManagedPrefixListEntriesResponse -> Maybe [PrefixListEntry]
entries} -> Maybe [PrefixListEntry]
entries) (\s :: GetManagedPrefixListEntriesResponse
s@GetManagedPrefixListEntriesResponse' {} Maybe [PrefixListEntry]
a -> GetManagedPrefixListEntriesResponse
s {$sel:entries:GetManagedPrefixListEntriesResponse' :: Maybe [PrefixListEntry]
entries = Maybe [PrefixListEntry]
a} :: GetManagedPrefixListEntriesResponse) 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.
getManagedPrefixListEntriesResponse_nextToken :: Lens.Lens' GetManagedPrefixListEntriesResponse (Prelude.Maybe Prelude.Text)
getManagedPrefixListEntriesResponse_nextToken :: Lens' GetManagedPrefixListEntriesResponse (Maybe Text)
getManagedPrefixListEntriesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedPrefixListEntriesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetManagedPrefixListEntriesResponse' :: GetManagedPrefixListEntriesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetManagedPrefixListEntriesResponse
s@GetManagedPrefixListEntriesResponse' {} Maybe Text
a -> GetManagedPrefixListEntriesResponse
s {$sel:nextToken:GetManagedPrefixListEntriesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetManagedPrefixListEntriesResponse)

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

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