{-# 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.GetTransitGatewayPrefixListReferences
-- 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 prefix list references in a specified transit
-- gateway route table.
--
-- This operation returns paginated results.
module Amazonka.EC2.GetTransitGatewayPrefixListReferences
  ( -- * Creating a Request
    GetTransitGatewayPrefixListReferences (..),
    newGetTransitGatewayPrefixListReferences,

    -- * Request Lenses
    getTransitGatewayPrefixListReferences_dryRun,
    getTransitGatewayPrefixListReferences_filters,
    getTransitGatewayPrefixListReferences_maxResults,
    getTransitGatewayPrefixListReferences_nextToken,
    getTransitGatewayPrefixListReferences_transitGatewayRouteTableId,

    -- * Destructuring the Response
    GetTransitGatewayPrefixListReferencesResponse (..),
    newGetTransitGatewayPrefixListReferencesResponse,

    -- * Response Lenses
    getTransitGatewayPrefixListReferencesResponse_nextToken,
    getTransitGatewayPrefixListReferencesResponse_transitGatewayPrefixListReferences,
    getTransitGatewayPrefixListReferencesResponse_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:/ 'newGetTransitGatewayPrefixListReferences' smart constructor.
data GetTransitGatewayPrefixListReferences = GetTransitGatewayPrefixListReferences'
  { -- | 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@.
    GetTransitGatewayPrefixListReferences -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters. The possible values are:
    --
    -- -   @attachment.resource-id@ - The ID of the resource for the
    --     attachment.
    --
    -- -   @attachment.resource-type@ - The type of resource for the
    --     attachment. Valid values are @vpc@ | @vpn@ |
    --     @direct-connect-gateway@ | @peering@.
    --
    -- -   @attachment.transit-gateway-attachment-id@ - The ID of the
    --     attachment.
    --
    -- -   @is-blackhole@ - Whether traffic matching the route is blocked
    --     (@true@ | @false@).
    --
    -- -   @prefix-list-id@ - The ID of the prefix list.
    --
    -- -   @prefix-list-owner-id@ - The ID of the owner of the prefix list.
    --
    -- -   @state@ - The state of the prefix list reference (@pending@ |
    --     @available@ | @modifying@ | @deleting@).
    GetTransitGatewayPrefixListReferences -> 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.
    GetTransitGatewayPrefixListReferences -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    GetTransitGatewayPrefixListReferences -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the transit gateway route table.
    GetTransitGatewayPrefixListReferences -> Text
transitGatewayRouteTableId :: Prelude.Text
  }
  deriving (GetTransitGatewayPrefixListReferences
-> GetTransitGatewayPrefixListReferences -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTransitGatewayPrefixListReferences
-> GetTransitGatewayPrefixListReferences -> Bool
$c/= :: GetTransitGatewayPrefixListReferences
-> GetTransitGatewayPrefixListReferences -> Bool
== :: GetTransitGatewayPrefixListReferences
-> GetTransitGatewayPrefixListReferences -> Bool
$c== :: GetTransitGatewayPrefixListReferences
-> GetTransitGatewayPrefixListReferences -> Bool
Prelude.Eq, ReadPrec [GetTransitGatewayPrefixListReferences]
ReadPrec GetTransitGatewayPrefixListReferences
Int -> ReadS GetTransitGatewayPrefixListReferences
ReadS [GetTransitGatewayPrefixListReferences]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTransitGatewayPrefixListReferences]
$creadListPrec :: ReadPrec [GetTransitGatewayPrefixListReferences]
readPrec :: ReadPrec GetTransitGatewayPrefixListReferences
$creadPrec :: ReadPrec GetTransitGatewayPrefixListReferences
readList :: ReadS [GetTransitGatewayPrefixListReferences]
$creadList :: ReadS [GetTransitGatewayPrefixListReferences]
readsPrec :: Int -> ReadS GetTransitGatewayPrefixListReferences
$creadsPrec :: Int -> ReadS GetTransitGatewayPrefixListReferences
Prelude.Read, Int -> GetTransitGatewayPrefixListReferences -> ShowS
[GetTransitGatewayPrefixListReferences] -> ShowS
GetTransitGatewayPrefixListReferences -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTransitGatewayPrefixListReferences] -> ShowS
$cshowList :: [GetTransitGatewayPrefixListReferences] -> ShowS
show :: GetTransitGatewayPrefixListReferences -> String
$cshow :: GetTransitGatewayPrefixListReferences -> String
showsPrec :: Int -> GetTransitGatewayPrefixListReferences -> ShowS
$cshowsPrec :: Int -> GetTransitGatewayPrefixListReferences -> ShowS
Prelude.Show, forall x.
Rep GetTransitGatewayPrefixListReferences x
-> GetTransitGatewayPrefixListReferences
forall x.
GetTransitGatewayPrefixListReferences
-> Rep GetTransitGatewayPrefixListReferences x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTransitGatewayPrefixListReferences x
-> GetTransitGatewayPrefixListReferences
$cfrom :: forall x.
GetTransitGatewayPrefixListReferences
-> Rep GetTransitGatewayPrefixListReferences x
Prelude.Generic)

-- |
-- Create a value of 'GetTransitGatewayPrefixListReferences' 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', 'getTransitGatewayPrefixListReferences_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', 'getTransitGatewayPrefixListReferences_filters' - One or more filters. The possible values are:
--
-- -   @attachment.resource-id@ - The ID of the resource for the
--     attachment.
--
-- -   @attachment.resource-type@ - The type of resource for the
--     attachment. Valid values are @vpc@ | @vpn@ |
--     @direct-connect-gateway@ | @peering@.
--
-- -   @attachment.transit-gateway-attachment-id@ - The ID of the
--     attachment.
--
-- -   @is-blackhole@ - Whether traffic matching the route is blocked
--     (@true@ | @false@).
--
-- -   @prefix-list-id@ - The ID of the prefix list.
--
-- -   @prefix-list-owner-id@ - The ID of the owner of the prefix list.
--
-- -   @state@ - The state of the prefix list reference (@pending@ |
--     @available@ | @modifying@ | @deleting@).
--
-- 'maxResults', 'getTransitGatewayPrefixListReferences_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', 'getTransitGatewayPrefixListReferences_nextToken' - The token for the next page of results.
--
-- 'transitGatewayRouteTableId', 'getTransitGatewayPrefixListReferences_transitGatewayRouteTableId' - The ID of the transit gateway route table.
newGetTransitGatewayPrefixListReferences ::
  -- | 'transitGatewayRouteTableId'
  Prelude.Text ->
  GetTransitGatewayPrefixListReferences
newGetTransitGatewayPrefixListReferences :: Text -> GetTransitGatewayPrefixListReferences
newGetTransitGatewayPrefixListReferences
  Text
pTransitGatewayRouteTableId_ =
    GetTransitGatewayPrefixListReferences'
      { $sel:dryRun:GetTransitGatewayPrefixListReferences' :: Maybe Bool
dryRun =
          forall a. Maybe a
Prelude.Nothing,
        $sel:filters:GetTransitGatewayPrefixListReferences' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:GetTransitGatewayPrefixListReferences' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetTransitGatewayPrefixListReferences' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayRouteTableId:GetTransitGatewayPrefixListReferences' :: Text
transitGatewayRouteTableId =
          Text
pTransitGatewayRouteTableId_
      }

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

-- | One or more filters. The possible values are:
--
-- -   @attachment.resource-id@ - The ID of the resource for the
--     attachment.
--
-- -   @attachment.resource-type@ - The type of resource for the
--     attachment. Valid values are @vpc@ | @vpn@ |
--     @direct-connect-gateway@ | @peering@.
--
-- -   @attachment.transit-gateway-attachment-id@ - The ID of the
--     attachment.
--
-- -   @is-blackhole@ - Whether traffic matching the route is blocked
--     (@true@ | @false@).
--
-- -   @prefix-list-id@ - The ID of the prefix list.
--
-- -   @prefix-list-owner-id@ - The ID of the owner of the prefix list.
--
-- -   @state@ - The state of the prefix list reference (@pending@ |
--     @available@ | @modifying@ | @deleting@).
getTransitGatewayPrefixListReferences_filters :: Lens.Lens' GetTransitGatewayPrefixListReferences (Prelude.Maybe [Filter])
getTransitGatewayPrefixListReferences_filters :: Lens' GetTransitGatewayPrefixListReferences (Maybe [Filter])
getTransitGatewayPrefixListReferences_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayPrefixListReferences' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: GetTransitGatewayPrefixListReferences
s@GetTransitGatewayPrefixListReferences' {} Maybe [Filter]
a -> GetTransitGatewayPrefixListReferences
s {$sel:filters:GetTransitGatewayPrefixListReferences' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: GetTransitGatewayPrefixListReferences) 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.
getTransitGatewayPrefixListReferences_maxResults :: Lens.Lens' GetTransitGatewayPrefixListReferences (Prelude.Maybe Prelude.Natural)
getTransitGatewayPrefixListReferences_maxResults :: Lens' GetTransitGatewayPrefixListReferences (Maybe Natural)
getTransitGatewayPrefixListReferences_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayPrefixListReferences' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetTransitGatewayPrefixListReferences
s@GetTransitGatewayPrefixListReferences' {} Maybe Natural
a -> GetTransitGatewayPrefixListReferences
s {$sel:maxResults:GetTransitGatewayPrefixListReferences' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetTransitGatewayPrefixListReferences)

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

-- | The ID of the transit gateway route table.
getTransitGatewayPrefixListReferences_transitGatewayRouteTableId :: Lens.Lens' GetTransitGatewayPrefixListReferences Prelude.Text
getTransitGatewayPrefixListReferences_transitGatewayRouteTableId :: Lens' GetTransitGatewayPrefixListReferences Text
getTransitGatewayPrefixListReferences_transitGatewayRouteTableId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayPrefixListReferences' {Text
transitGatewayRouteTableId :: Text
$sel:transitGatewayRouteTableId:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Text
transitGatewayRouteTableId} -> Text
transitGatewayRouteTableId) (\s :: GetTransitGatewayPrefixListReferences
s@GetTransitGatewayPrefixListReferences' {} Text
a -> GetTransitGatewayPrefixListReferences
s {$sel:transitGatewayRouteTableId:GetTransitGatewayPrefixListReferences' :: Text
transitGatewayRouteTableId = Text
a} :: GetTransitGatewayPrefixListReferences)

instance
  Core.AWSPager
    GetTransitGatewayPrefixListReferences
  where
  page :: GetTransitGatewayPrefixListReferences
-> AWSResponse GetTransitGatewayPrefixListReferences
-> Maybe GetTransitGatewayPrefixListReferences
page GetTransitGatewayPrefixListReferences
rq AWSResponse GetTransitGatewayPrefixListReferences
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetTransitGatewayPrefixListReferences
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetTransitGatewayPrefixListReferencesResponse (Maybe Text)
getTransitGatewayPrefixListReferencesResponse_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 GetTransitGatewayPrefixListReferences
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  GetTransitGatewayPrefixListReferencesResponse
  (Maybe [TransitGatewayPrefixListReference])
getTransitGatewayPrefixListReferencesResponse_transitGatewayPrefixListReferences
            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.$ GetTransitGatewayPrefixListReferences
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetTransitGatewayPrefixListReferences (Maybe Text)
getTransitGatewayPrefixListReferences_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetTransitGatewayPrefixListReferences
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetTransitGatewayPrefixListReferencesResponse (Maybe Text)
getTransitGatewayPrefixListReferencesResponse_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
    GetTransitGatewayPrefixListReferences
  where
  type
    AWSResponse
      GetTransitGatewayPrefixListReferences =
      GetTransitGatewayPrefixListReferencesResponse
  request :: (Service -> Service)
-> GetTransitGatewayPrefixListReferences
-> Request GetTransitGatewayPrefixListReferences
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 GetTransitGatewayPrefixListReferences
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetTransitGatewayPrefixListReferences)))
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 [TransitGatewayPrefixListReference]
-> Int
-> GetTransitGatewayPrefixListReferencesResponse
GetTransitGatewayPrefixListReferencesResponse'
            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
"transitGatewayPrefixListReferenceSet"
                            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
    GetTransitGatewayPrefixListReferences
  where
  hashWithSalt :: Int -> GetTransitGatewayPrefixListReferences -> Int
hashWithSalt
    Int
_salt
    GetTransitGatewayPrefixListReferences' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Text
transitGatewayRouteTableId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:transitGatewayRouteTableId:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Text
$sel:nextToken:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe Text
$sel:maxResults:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe Natural
$sel:filters:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe [Filter]
$sel:dryRun:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe Bool
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
transitGatewayRouteTableId

instance
  Prelude.NFData
    GetTransitGatewayPrefixListReferences
  where
  rnf :: GetTransitGatewayPrefixListReferences -> ()
rnf GetTransitGatewayPrefixListReferences' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Text
transitGatewayRouteTableId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:transitGatewayRouteTableId:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Text
$sel:nextToken:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe Text
$sel:maxResults:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe Natural
$sel:filters:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe [Filter]
$sel:dryRun:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
transitGatewayRouteTableId

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

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

instance
  Data.ToQuery
    GetTransitGatewayPrefixListReferences
  where
  toQuery :: GetTransitGatewayPrefixListReferences -> QueryString
toQuery GetTransitGatewayPrefixListReferences' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Text
transitGatewayRouteTableId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:transitGatewayRouteTableId:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Text
$sel:nextToken:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe Text
$sel:maxResults:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe Natural
$sel:filters:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe [Filter]
$sel:dryRun:GetTransitGatewayPrefixListReferences' :: GetTransitGatewayPrefixListReferences -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"GetTransitGatewayPrefixListReferences" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"TransitGatewayRouteTableId"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
transitGatewayRouteTableId
      ]

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

-- |
-- Create a value of 'GetTransitGatewayPrefixListReferencesResponse' 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', 'getTransitGatewayPrefixListReferencesResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'transitGatewayPrefixListReferences', 'getTransitGatewayPrefixListReferencesResponse_transitGatewayPrefixListReferences' - Information about the prefix list references.
--
-- 'httpStatus', 'getTransitGatewayPrefixListReferencesResponse_httpStatus' - The response's http status code.
newGetTransitGatewayPrefixListReferencesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTransitGatewayPrefixListReferencesResponse
newGetTransitGatewayPrefixListReferencesResponse :: Int -> GetTransitGatewayPrefixListReferencesResponse
newGetTransitGatewayPrefixListReferencesResponse
  Int
pHttpStatus_ =
    GetTransitGatewayPrefixListReferencesResponse'
      { $sel:nextToken:GetTransitGatewayPrefixListReferencesResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayPrefixListReferences:GetTransitGatewayPrefixListReferencesResponse' :: Maybe [TransitGatewayPrefixListReference]
transitGatewayPrefixListReferences =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetTransitGatewayPrefixListReferencesResponse' :: 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.
getTransitGatewayPrefixListReferencesResponse_nextToken :: Lens.Lens' GetTransitGatewayPrefixListReferencesResponse (Prelude.Maybe Prelude.Text)
getTransitGatewayPrefixListReferencesResponse_nextToken :: Lens' GetTransitGatewayPrefixListReferencesResponse (Maybe Text)
getTransitGatewayPrefixListReferencesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayPrefixListReferencesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTransitGatewayPrefixListReferencesResponse' :: GetTransitGatewayPrefixListReferencesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTransitGatewayPrefixListReferencesResponse
s@GetTransitGatewayPrefixListReferencesResponse' {} Maybe Text
a -> GetTransitGatewayPrefixListReferencesResponse
s {$sel:nextToken:GetTransitGatewayPrefixListReferencesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetTransitGatewayPrefixListReferencesResponse)

-- | Information about the prefix list references.
getTransitGatewayPrefixListReferencesResponse_transitGatewayPrefixListReferences :: Lens.Lens' GetTransitGatewayPrefixListReferencesResponse (Prelude.Maybe [TransitGatewayPrefixListReference])
getTransitGatewayPrefixListReferencesResponse_transitGatewayPrefixListReferences :: Lens'
  GetTransitGatewayPrefixListReferencesResponse
  (Maybe [TransitGatewayPrefixListReference])
getTransitGatewayPrefixListReferencesResponse_transitGatewayPrefixListReferences = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayPrefixListReferencesResponse' {Maybe [TransitGatewayPrefixListReference]
transitGatewayPrefixListReferences :: Maybe [TransitGatewayPrefixListReference]
$sel:transitGatewayPrefixListReferences:GetTransitGatewayPrefixListReferencesResponse' :: GetTransitGatewayPrefixListReferencesResponse
-> Maybe [TransitGatewayPrefixListReference]
transitGatewayPrefixListReferences} -> Maybe [TransitGatewayPrefixListReference]
transitGatewayPrefixListReferences) (\s :: GetTransitGatewayPrefixListReferencesResponse
s@GetTransitGatewayPrefixListReferencesResponse' {} Maybe [TransitGatewayPrefixListReference]
a -> GetTransitGatewayPrefixListReferencesResponse
s {$sel:transitGatewayPrefixListReferences:GetTransitGatewayPrefixListReferencesResponse' :: Maybe [TransitGatewayPrefixListReference]
transitGatewayPrefixListReferences = Maybe [TransitGatewayPrefixListReference]
a} :: GetTransitGatewayPrefixListReferencesResponse) 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.
getTransitGatewayPrefixListReferencesResponse_httpStatus :: Lens.Lens' GetTransitGatewayPrefixListReferencesResponse Prelude.Int
getTransitGatewayPrefixListReferencesResponse_httpStatus :: Lens' GetTransitGatewayPrefixListReferencesResponse Int
getTransitGatewayPrefixListReferencesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayPrefixListReferencesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetTransitGatewayPrefixListReferencesResponse' :: GetTransitGatewayPrefixListReferencesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetTransitGatewayPrefixListReferencesResponse
s@GetTransitGatewayPrefixListReferencesResponse' {} Int
a -> GetTransitGatewayPrefixListReferencesResponse
s {$sel:httpStatus:GetTransitGatewayPrefixListReferencesResponse' :: Int
httpStatus = Int
a} :: GetTransitGatewayPrefixListReferencesResponse)

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