{-# 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.GetManagedPrefixListAssociations
-- 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 resources that are associated with the
-- specified managed prefix list.
--
-- This operation returns paginated results.
module Amazonka.EC2.GetManagedPrefixListAssociations
  ( -- * Creating a Request
    GetManagedPrefixListAssociations (..),
    newGetManagedPrefixListAssociations,

    -- * Request Lenses
    getManagedPrefixListAssociations_dryRun,
    getManagedPrefixListAssociations_maxResults,
    getManagedPrefixListAssociations_nextToken,
    getManagedPrefixListAssociations_prefixListId,

    -- * Destructuring the Response
    GetManagedPrefixListAssociationsResponse (..),
    newGetManagedPrefixListAssociationsResponse,

    -- * Response Lenses
    getManagedPrefixListAssociationsResponse_nextToken,
    getManagedPrefixListAssociationsResponse_prefixListAssociations,
    getManagedPrefixListAssociationsResponse_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:/ 'newGetManagedPrefixListAssociations' smart constructor.
data GetManagedPrefixListAssociations = GetManagedPrefixListAssociations'
  { -- | 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@.
    GetManagedPrefixListAssociations -> 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.
    GetManagedPrefixListAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    GetManagedPrefixListAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the prefix list.
    GetManagedPrefixListAssociations -> Text
prefixListId :: Prelude.Text
  }
  deriving (GetManagedPrefixListAssociations
-> GetManagedPrefixListAssociations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetManagedPrefixListAssociations
-> GetManagedPrefixListAssociations -> Bool
$c/= :: GetManagedPrefixListAssociations
-> GetManagedPrefixListAssociations -> Bool
== :: GetManagedPrefixListAssociations
-> GetManagedPrefixListAssociations -> Bool
$c== :: GetManagedPrefixListAssociations
-> GetManagedPrefixListAssociations -> Bool
Prelude.Eq, ReadPrec [GetManagedPrefixListAssociations]
ReadPrec GetManagedPrefixListAssociations
Int -> ReadS GetManagedPrefixListAssociations
ReadS [GetManagedPrefixListAssociations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetManagedPrefixListAssociations]
$creadListPrec :: ReadPrec [GetManagedPrefixListAssociations]
readPrec :: ReadPrec GetManagedPrefixListAssociations
$creadPrec :: ReadPrec GetManagedPrefixListAssociations
readList :: ReadS [GetManagedPrefixListAssociations]
$creadList :: ReadS [GetManagedPrefixListAssociations]
readsPrec :: Int -> ReadS GetManagedPrefixListAssociations
$creadsPrec :: Int -> ReadS GetManagedPrefixListAssociations
Prelude.Read, Int -> GetManagedPrefixListAssociations -> ShowS
[GetManagedPrefixListAssociations] -> ShowS
GetManagedPrefixListAssociations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetManagedPrefixListAssociations] -> ShowS
$cshowList :: [GetManagedPrefixListAssociations] -> ShowS
show :: GetManagedPrefixListAssociations -> String
$cshow :: GetManagedPrefixListAssociations -> String
showsPrec :: Int -> GetManagedPrefixListAssociations -> ShowS
$cshowsPrec :: Int -> GetManagedPrefixListAssociations -> ShowS
Prelude.Show, forall x.
Rep GetManagedPrefixListAssociations x
-> GetManagedPrefixListAssociations
forall x.
GetManagedPrefixListAssociations
-> Rep GetManagedPrefixListAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetManagedPrefixListAssociations x
-> GetManagedPrefixListAssociations
$cfrom :: forall x.
GetManagedPrefixListAssociations
-> Rep GetManagedPrefixListAssociations x
Prelude.Generic)

-- |
-- Create a value of 'GetManagedPrefixListAssociations' 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', 'getManagedPrefixListAssociations_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', 'getManagedPrefixListAssociations_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', 'getManagedPrefixListAssociations_nextToken' - The token for the next page of results.
--
-- 'prefixListId', 'getManagedPrefixListAssociations_prefixListId' - The ID of the prefix list.
newGetManagedPrefixListAssociations ::
  -- | 'prefixListId'
  Prelude.Text ->
  GetManagedPrefixListAssociations
newGetManagedPrefixListAssociations :: Text -> GetManagedPrefixListAssociations
newGetManagedPrefixListAssociations Text
pPrefixListId_ =
  GetManagedPrefixListAssociations'
    { $sel:dryRun:GetManagedPrefixListAssociations' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetManagedPrefixListAssociations' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetManagedPrefixListAssociations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:prefixListId:GetManagedPrefixListAssociations' :: 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@.
getManagedPrefixListAssociations_dryRun :: Lens.Lens' GetManagedPrefixListAssociations (Prelude.Maybe Prelude.Bool)
getManagedPrefixListAssociations_dryRun :: Lens' GetManagedPrefixListAssociations (Maybe Bool)
getManagedPrefixListAssociations_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedPrefixListAssociations' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:GetManagedPrefixListAssociations' :: GetManagedPrefixListAssociations -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: GetManagedPrefixListAssociations
s@GetManagedPrefixListAssociations' {} Maybe Bool
a -> GetManagedPrefixListAssociations
s {$sel:dryRun:GetManagedPrefixListAssociations' :: Maybe Bool
dryRun = Maybe Bool
a} :: GetManagedPrefixListAssociations)

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

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

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

instance
  Core.AWSPager
    GetManagedPrefixListAssociations
  where
  page :: GetManagedPrefixListAssociations
-> AWSResponse GetManagedPrefixListAssociations
-> Maybe GetManagedPrefixListAssociations
page GetManagedPrefixListAssociations
rq AWSResponse GetManagedPrefixListAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetManagedPrefixListAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetManagedPrefixListAssociationsResponse (Maybe Text)
getManagedPrefixListAssociationsResponse_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 GetManagedPrefixListAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  GetManagedPrefixListAssociationsResponse
  (Maybe [PrefixListAssociation])
getManagedPrefixListAssociationsResponse_prefixListAssociations
            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.$ GetManagedPrefixListAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetManagedPrefixListAssociations (Maybe Text)
getManagedPrefixListAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetManagedPrefixListAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetManagedPrefixListAssociationsResponse (Maybe Text)
getManagedPrefixListAssociationsResponse_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
    GetManagedPrefixListAssociations
  where
  type
    AWSResponse GetManagedPrefixListAssociations =
      GetManagedPrefixListAssociationsResponse
  request :: (Service -> Service)
-> GetManagedPrefixListAssociations
-> Request GetManagedPrefixListAssociations
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 GetManagedPrefixListAssociations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetManagedPrefixListAssociations)))
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 [PrefixListAssociation]
-> Int
-> GetManagedPrefixListAssociationsResponse
GetManagedPrefixListAssociationsResponse'
            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
"prefixListAssociationSet"
                            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
    GetManagedPrefixListAssociations
  where
  hashWithSalt :: Int -> GetManagedPrefixListAssociations -> Int
hashWithSalt
    Int
_salt
    GetManagedPrefixListAssociations' {Maybe Bool
Maybe Natural
Maybe Text
Text
prefixListId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
dryRun :: Maybe Bool
$sel:prefixListId:GetManagedPrefixListAssociations' :: GetManagedPrefixListAssociations -> Text
$sel:nextToken:GetManagedPrefixListAssociations' :: GetManagedPrefixListAssociations -> Maybe Text
$sel:maxResults:GetManagedPrefixListAssociations' :: GetManagedPrefixListAssociations -> Maybe Natural
$sel:dryRun:GetManagedPrefixListAssociations' :: GetManagedPrefixListAssociations -> 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` Text
prefixListId

instance
  Prelude.NFData
    GetManagedPrefixListAssociations
  where
  rnf :: GetManagedPrefixListAssociations -> ()
rnf GetManagedPrefixListAssociations' {Maybe Bool
Maybe Natural
Maybe Text
Text
prefixListId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
dryRun :: Maybe Bool
$sel:prefixListId:GetManagedPrefixListAssociations' :: GetManagedPrefixListAssociations -> Text
$sel:nextToken:GetManagedPrefixListAssociations' :: GetManagedPrefixListAssociations -> Maybe Text
$sel:maxResults:GetManagedPrefixListAssociations' :: GetManagedPrefixListAssociations -> Maybe Natural
$sel:dryRun:GetManagedPrefixListAssociations' :: GetManagedPrefixListAssociations -> 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 Text
prefixListId

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

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

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

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

-- |
-- Create a value of 'GetManagedPrefixListAssociationsResponse' 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', 'getManagedPrefixListAssociationsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'prefixListAssociations', 'getManagedPrefixListAssociationsResponse_prefixListAssociations' - Information about the associations.
--
-- 'httpStatus', 'getManagedPrefixListAssociationsResponse_httpStatus' - The response's http status code.
newGetManagedPrefixListAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetManagedPrefixListAssociationsResponse
newGetManagedPrefixListAssociationsResponse :: Int -> GetManagedPrefixListAssociationsResponse
newGetManagedPrefixListAssociationsResponse
  Int
pHttpStatus_ =
    GetManagedPrefixListAssociationsResponse'
      { $sel:nextToken:GetManagedPrefixListAssociationsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:prefixListAssociations:GetManagedPrefixListAssociationsResponse' :: Maybe [PrefixListAssociation]
prefixListAssociations =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetManagedPrefixListAssociationsResponse' :: 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.
getManagedPrefixListAssociationsResponse_nextToken :: Lens.Lens' GetManagedPrefixListAssociationsResponse (Prelude.Maybe Prelude.Text)
getManagedPrefixListAssociationsResponse_nextToken :: Lens' GetManagedPrefixListAssociationsResponse (Maybe Text)
getManagedPrefixListAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedPrefixListAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetManagedPrefixListAssociationsResponse' :: GetManagedPrefixListAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetManagedPrefixListAssociationsResponse
s@GetManagedPrefixListAssociationsResponse' {} Maybe Text
a -> GetManagedPrefixListAssociationsResponse
s {$sel:nextToken:GetManagedPrefixListAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetManagedPrefixListAssociationsResponse)

-- | Information about the associations.
getManagedPrefixListAssociationsResponse_prefixListAssociations :: Lens.Lens' GetManagedPrefixListAssociationsResponse (Prelude.Maybe [PrefixListAssociation])
getManagedPrefixListAssociationsResponse_prefixListAssociations :: Lens'
  GetManagedPrefixListAssociationsResponse
  (Maybe [PrefixListAssociation])
getManagedPrefixListAssociationsResponse_prefixListAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedPrefixListAssociationsResponse' {Maybe [PrefixListAssociation]
prefixListAssociations :: Maybe [PrefixListAssociation]
$sel:prefixListAssociations:GetManagedPrefixListAssociationsResponse' :: GetManagedPrefixListAssociationsResponse
-> Maybe [PrefixListAssociation]
prefixListAssociations} -> Maybe [PrefixListAssociation]
prefixListAssociations) (\s :: GetManagedPrefixListAssociationsResponse
s@GetManagedPrefixListAssociationsResponse' {} Maybe [PrefixListAssociation]
a -> GetManagedPrefixListAssociationsResponse
s {$sel:prefixListAssociations:GetManagedPrefixListAssociationsResponse' :: Maybe [PrefixListAssociation]
prefixListAssociations = Maybe [PrefixListAssociation]
a} :: GetManagedPrefixListAssociationsResponse) 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.
getManagedPrefixListAssociationsResponse_httpStatus :: Lens.Lens' GetManagedPrefixListAssociationsResponse Prelude.Int
getManagedPrefixListAssociationsResponse_httpStatus :: Lens' GetManagedPrefixListAssociationsResponse Int
getManagedPrefixListAssociationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedPrefixListAssociationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetManagedPrefixListAssociationsResponse' :: GetManagedPrefixListAssociationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetManagedPrefixListAssociationsResponse
s@GetManagedPrefixListAssociationsResponse' {} Int
a -> GetManagedPrefixListAssociationsResponse
s {$sel:httpStatus:GetManagedPrefixListAssociationsResponse' :: Int
httpStatus = Int
a} :: GetManagedPrefixListAssociationsResponse)

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