{-# 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.DescribeTransitGatewayRouteTables
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes one or more transit gateway route tables. By default, all
-- transit gateway route tables are described. Alternatively, you can
-- filter the results.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeTransitGatewayRouteTables
  ( -- * Creating a Request
    DescribeTransitGatewayRouteTables (..),
    newDescribeTransitGatewayRouteTables,

    -- * Request Lenses
    describeTransitGatewayRouteTables_dryRun,
    describeTransitGatewayRouteTables_filters,
    describeTransitGatewayRouteTables_maxResults,
    describeTransitGatewayRouteTables_nextToken,
    describeTransitGatewayRouteTables_transitGatewayRouteTableIds,

    -- * Destructuring the Response
    DescribeTransitGatewayRouteTablesResponse (..),
    newDescribeTransitGatewayRouteTablesResponse,

    -- * Response Lenses
    describeTransitGatewayRouteTablesResponse_nextToken,
    describeTransitGatewayRouteTablesResponse_transitGatewayRouteTables,
    describeTransitGatewayRouteTablesResponse_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:/ 'newDescribeTransitGatewayRouteTables' smart constructor.
data DescribeTransitGatewayRouteTables = DescribeTransitGatewayRouteTables'
  { -- | 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@.
    DescribeTransitGatewayRouteTables -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters. The possible values are:
    --
    -- -   @default-association-route-table@ - Indicates whether this is the
    --     default association route table for the transit gateway (@true@ |
    --     @false@).
    --
    -- -   @default-propagation-route-table@ - Indicates whether this is the
    --     default propagation route table for the transit gateway (@true@ |
    --     @false@).
    --
    -- -   @state@ - The state of the route table (@available@ | @deleting@ |
    --     @deleted@ | @pending@).
    --
    -- -   @transit-gateway-id@ - The ID of the transit gateway.
    --
    -- -   @transit-gateway-route-table-id@ - The ID of the transit gateway
    --     route table.
    DescribeTransitGatewayRouteTables -> 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.
    DescribeTransitGatewayRouteTables -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    DescribeTransitGatewayRouteTables -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The IDs of the transit gateway route tables.
    DescribeTransitGatewayRouteTables -> Maybe [Text]
transitGatewayRouteTableIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeTransitGatewayRouteTables
-> DescribeTransitGatewayRouteTables -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTransitGatewayRouteTables
-> DescribeTransitGatewayRouteTables -> Bool
$c/= :: DescribeTransitGatewayRouteTables
-> DescribeTransitGatewayRouteTables -> Bool
== :: DescribeTransitGatewayRouteTables
-> DescribeTransitGatewayRouteTables -> Bool
$c== :: DescribeTransitGatewayRouteTables
-> DescribeTransitGatewayRouteTables -> Bool
Prelude.Eq, ReadPrec [DescribeTransitGatewayRouteTables]
ReadPrec DescribeTransitGatewayRouteTables
Int -> ReadS DescribeTransitGatewayRouteTables
ReadS [DescribeTransitGatewayRouteTables]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTransitGatewayRouteTables]
$creadListPrec :: ReadPrec [DescribeTransitGatewayRouteTables]
readPrec :: ReadPrec DescribeTransitGatewayRouteTables
$creadPrec :: ReadPrec DescribeTransitGatewayRouteTables
readList :: ReadS [DescribeTransitGatewayRouteTables]
$creadList :: ReadS [DescribeTransitGatewayRouteTables]
readsPrec :: Int -> ReadS DescribeTransitGatewayRouteTables
$creadsPrec :: Int -> ReadS DescribeTransitGatewayRouteTables
Prelude.Read, Int -> DescribeTransitGatewayRouteTables -> ShowS
[DescribeTransitGatewayRouteTables] -> ShowS
DescribeTransitGatewayRouteTables -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTransitGatewayRouteTables] -> ShowS
$cshowList :: [DescribeTransitGatewayRouteTables] -> ShowS
show :: DescribeTransitGatewayRouteTables -> String
$cshow :: DescribeTransitGatewayRouteTables -> String
showsPrec :: Int -> DescribeTransitGatewayRouteTables -> ShowS
$cshowsPrec :: Int -> DescribeTransitGatewayRouteTables -> ShowS
Prelude.Show, forall x.
Rep DescribeTransitGatewayRouteTables x
-> DescribeTransitGatewayRouteTables
forall x.
DescribeTransitGatewayRouteTables
-> Rep DescribeTransitGatewayRouteTables x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTransitGatewayRouteTables x
-> DescribeTransitGatewayRouteTables
$cfrom :: forall x.
DescribeTransitGatewayRouteTables
-> Rep DescribeTransitGatewayRouteTables x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTransitGatewayRouteTables' 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', 'describeTransitGatewayRouteTables_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', 'describeTransitGatewayRouteTables_filters' - One or more filters. The possible values are:
--
-- -   @default-association-route-table@ - Indicates whether this is the
--     default association route table for the transit gateway (@true@ |
--     @false@).
--
-- -   @default-propagation-route-table@ - Indicates whether this is the
--     default propagation route table for the transit gateway (@true@ |
--     @false@).
--
-- -   @state@ - The state of the route table (@available@ | @deleting@ |
--     @deleted@ | @pending@).
--
-- -   @transit-gateway-id@ - The ID of the transit gateway.
--
-- -   @transit-gateway-route-table-id@ - The ID of the transit gateway
--     route table.
--
-- 'maxResults', 'describeTransitGatewayRouteTables_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', 'describeTransitGatewayRouteTables_nextToken' - The token for the next page of results.
--
-- 'transitGatewayRouteTableIds', 'describeTransitGatewayRouteTables_transitGatewayRouteTableIds' - The IDs of the transit gateway route tables.
newDescribeTransitGatewayRouteTables ::
  DescribeTransitGatewayRouteTables
newDescribeTransitGatewayRouteTables :: DescribeTransitGatewayRouteTables
newDescribeTransitGatewayRouteTables =
  DescribeTransitGatewayRouteTables'
    { $sel:dryRun:DescribeTransitGatewayRouteTables' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeTransitGatewayRouteTables' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeTransitGatewayRouteTables' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeTransitGatewayRouteTables' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:transitGatewayRouteTableIds:DescribeTransitGatewayRouteTables' :: Maybe [Text]
transitGatewayRouteTableIds =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
describeTransitGatewayRouteTables_dryRun :: Lens.Lens' DescribeTransitGatewayRouteTables (Prelude.Maybe Prelude.Bool)
describeTransitGatewayRouteTables_dryRun :: Lens' DescribeTransitGatewayRouteTables (Maybe Bool)
describeTransitGatewayRouteTables_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayRouteTables' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeTransitGatewayRouteTables' :: DescribeTransitGatewayRouteTables -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeTransitGatewayRouteTables
s@DescribeTransitGatewayRouteTables' {} Maybe Bool
a -> DescribeTransitGatewayRouteTables
s {$sel:dryRun:DescribeTransitGatewayRouteTables' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeTransitGatewayRouteTables)

-- | One or more filters. The possible values are:
--
-- -   @default-association-route-table@ - Indicates whether this is the
--     default association route table for the transit gateway (@true@ |
--     @false@).
--
-- -   @default-propagation-route-table@ - Indicates whether this is the
--     default propagation route table for the transit gateway (@true@ |
--     @false@).
--
-- -   @state@ - The state of the route table (@available@ | @deleting@ |
--     @deleted@ | @pending@).
--
-- -   @transit-gateway-id@ - The ID of the transit gateway.
--
-- -   @transit-gateway-route-table-id@ - The ID of the transit gateway
--     route table.
describeTransitGatewayRouteTables_filters :: Lens.Lens' DescribeTransitGatewayRouteTables (Prelude.Maybe [Filter])
describeTransitGatewayRouteTables_filters :: Lens' DescribeTransitGatewayRouteTables (Maybe [Filter])
describeTransitGatewayRouteTables_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayRouteTables' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeTransitGatewayRouteTables' :: DescribeTransitGatewayRouteTables -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeTransitGatewayRouteTables
s@DescribeTransitGatewayRouteTables' {} Maybe [Filter]
a -> DescribeTransitGatewayRouteTables
s {$sel:filters:DescribeTransitGatewayRouteTables' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeTransitGatewayRouteTables) 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.
describeTransitGatewayRouteTables_maxResults :: Lens.Lens' DescribeTransitGatewayRouteTables (Prelude.Maybe Prelude.Natural)
describeTransitGatewayRouteTables_maxResults :: Lens' DescribeTransitGatewayRouteTables (Maybe Natural)
describeTransitGatewayRouteTables_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayRouteTables' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeTransitGatewayRouteTables' :: DescribeTransitGatewayRouteTables -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeTransitGatewayRouteTables
s@DescribeTransitGatewayRouteTables' {} Maybe Natural
a -> DescribeTransitGatewayRouteTables
s {$sel:maxResults:DescribeTransitGatewayRouteTables' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeTransitGatewayRouteTables)

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

-- | The IDs of the transit gateway route tables.
describeTransitGatewayRouteTables_transitGatewayRouteTableIds :: Lens.Lens' DescribeTransitGatewayRouteTables (Prelude.Maybe [Prelude.Text])
describeTransitGatewayRouteTables_transitGatewayRouteTableIds :: Lens' DescribeTransitGatewayRouteTables (Maybe [Text])
describeTransitGatewayRouteTables_transitGatewayRouteTableIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayRouteTables' {Maybe [Text]
transitGatewayRouteTableIds :: Maybe [Text]
$sel:transitGatewayRouteTableIds:DescribeTransitGatewayRouteTables' :: DescribeTransitGatewayRouteTables -> Maybe [Text]
transitGatewayRouteTableIds} -> Maybe [Text]
transitGatewayRouteTableIds) (\s :: DescribeTransitGatewayRouteTables
s@DescribeTransitGatewayRouteTables' {} Maybe [Text]
a -> DescribeTransitGatewayRouteTables
s {$sel:transitGatewayRouteTableIds:DescribeTransitGatewayRouteTables' :: Maybe [Text]
transitGatewayRouteTableIds = Maybe [Text]
a} :: DescribeTransitGatewayRouteTables) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

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

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

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

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

-- |
-- Create a value of 'DescribeTransitGatewayRouteTablesResponse' 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', 'describeTransitGatewayRouteTablesResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'transitGatewayRouteTables', 'describeTransitGatewayRouteTablesResponse_transitGatewayRouteTables' - Information about the transit gateway route tables.
--
-- 'httpStatus', 'describeTransitGatewayRouteTablesResponse_httpStatus' - The response's http status code.
newDescribeTransitGatewayRouteTablesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTransitGatewayRouteTablesResponse
newDescribeTransitGatewayRouteTablesResponse :: Int -> DescribeTransitGatewayRouteTablesResponse
newDescribeTransitGatewayRouteTablesResponse
  Int
pHttpStatus_ =
    DescribeTransitGatewayRouteTablesResponse'
      { $sel:nextToken:DescribeTransitGatewayRouteTablesResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayRouteTables:DescribeTransitGatewayRouteTablesResponse' :: Maybe [TransitGatewayRouteTable]
transitGatewayRouteTables =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeTransitGatewayRouteTablesResponse' :: 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.
describeTransitGatewayRouteTablesResponse_nextToken :: Lens.Lens' DescribeTransitGatewayRouteTablesResponse (Prelude.Maybe Prelude.Text)
describeTransitGatewayRouteTablesResponse_nextToken :: Lens' DescribeTransitGatewayRouteTablesResponse (Maybe Text)
describeTransitGatewayRouteTablesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayRouteTablesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTransitGatewayRouteTablesResponse' :: DescribeTransitGatewayRouteTablesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTransitGatewayRouteTablesResponse
s@DescribeTransitGatewayRouteTablesResponse' {} Maybe Text
a -> DescribeTransitGatewayRouteTablesResponse
s {$sel:nextToken:DescribeTransitGatewayRouteTablesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTransitGatewayRouteTablesResponse)

-- | Information about the transit gateway route tables.
describeTransitGatewayRouteTablesResponse_transitGatewayRouteTables :: Lens.Lens' DescribeTransitGatewayRouteTablesResponse (Prelude.Maybe [TransitGatewayRouteTable])
describeTransitGatewayRouteTablesResponse_transitGatewayRouteTables :: Lens'
  DescribeTransitGatewayRouteTablesResponse
  (Maybe [TransitGatewayRouteTable])
describeTransitGatewayRouteTablesResponse_transitGatewayRouteTables = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayRouteTablesResponse' {Maybe [TransitGatewayRouteTable]
transitGatewayRouteTables :: Maybe [TransitGatewayRouteTable]
$sel:transitGatewayRouteTables:DescribeTransitGatewayRouteTablesResponse' :: DescribeTransitGatewayRouteTablesResponse
-> Maybe [TransitGatewayRouteTable]
transitGatewayRouteTables} -> Maybe [TransitGatewayRouteTable]
transitGatewayRouteTables) (\s :: DescribeTransitGatewayRouteTablesResponse
s@DescribeTransitGatewayRouteTablesResponse' {} Maybe [TransitGatewayRouteTable]
a -> DescribeTransitGatewayRouteTablesResponse
s {$sel:transitGatewayRouteTables:DescribeTransitGatewayRouteTablesResponse' :: Maybe [TransitGatewayRouteTable]
transitGatewayRouteTables = Maybe [TransitGatewayRouteTable]
a} :: DescribeTransitGatewayRouteTablesResponse) 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.
describeTransitGatewayRouteTablesResponse_httpStatus :: Lens.Lens' DescribeTransitGatewayRouteTablesResponse Prelude.Int
describeTransitGatewayRouteTablesResponse_httpStatus :: Lens' DescribeTransitGatewayRouteTablesResponse Int
describeTransitGatewayRouteTablesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayRouteTablesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeTransitGatewayRouteTablesResponse' :: DescribeTransitGatewayRouteTablesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeTransitGatewayRouteTablesResponse
s@DescribeTransitGatewayRouteTablesResponse' {} Int
a -> DescribeTransitGatewayRouteTablesResponse
s {$sel:httpStatus:DescribeTransitGatewayRouteTablesResponse' :: Int
httpStatus = Int
a} :: DescribeTransitGatewayRouteTablesResponse)

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