{-# 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.DescribeLocalGatewayRouteTables
-- 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 local gateway route tables. By default, all local
-- gateway route tables are described. Alternatively, you can filter the
-- results.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeLocalGatewayRouteTables
  ( -- * Creating a Request
    DescribeLocalGatewayRouteTables (..),
    newDescribeLocalGatewayRouteTables,

    -- * Request Lenses
    describeLocalGatewayRouteTables_dryRun,
    describeLocalGatewayRouteTables_filters,
    describeLocalGatewayRouteTables_localGatewayRouteTableIds,
    describeLocalGatewayRouteTables_maxResults,
    describeLocalGatewayRouteTables_nextToken,

    -- * Destructuring the Response
    DescribeLocalGatewayRouteTablesResponse (..),
    newDescribeLocalGatewayRouteTablesResponse,

    -- * Response Lenses
    describeLocalGatewayRouteTablesResponse_localGatewayRouteTables,
    describeLocalGatewayRouteTablesResponse_nextToken,
    describeLocalGatewayRouteTablesResponse_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:/ 'newDescribeLocalGatewayRouteTables' smart constructor.
data DescribeLocalGatewayRouteTables = DescribeLocalGatewayRouteTables'
  { -- | 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@.
    DescribeLocalGatewayRouteTables -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters.
    --
    -- -   @local-gateway-id@ - The ID of a local gateway.
    --
    -- -   @local-gateway-route-table-arn@ - The Amazon Resource Name (ARN) of
    --     the local gateway route table.
    --
    -- -   @local-gateway-route-table-id@ - The ID of a local gateway route
    --     table.
    --
    -- -   @outpost-arn@ - The Amazon Resource Name (ARN) of the Outpost.
    --
    -- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
    --     local gateway route table.
    --
    -- -   @state@ - The state of the local gateway route table.
    DescribeLocalGatewayRouteTables -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The IDs of the local gateway route tables.
    DescribeLocalGatewayRouteTables -> Maybe [Text]
localGatewayRouteTableIds :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    DescribeLocalGatewayRouteTables -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    DescribeLocalGatewayRouteTables -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeLocalGatewayRouteTables
-> DescribeLocalGatewayRouteTables -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLocalGatewayRouteTables
-> DescribeLocalGatewayRouteTables -> Bool
$c/= :: DescribeLocalGatewayRouteTables
-> DescribeLocalGatewayRouteTables -> Bool
== :: DescribeLocalGatewayRouteTables
-> DescribeLocalGatewayRouteTables -> Bool
$c== :: DescribeLocalGatewayRouteTables
-> DescribeLocalGatewayRouteTables -> Bool
Prelude.Eq, ReadPrec [DescribeLocalGatewayRouteTables]
ReadPrec DescribeLocalGatewayRouteTables
Int -> ReadS DescribeLocalGatewayRouteTables
ReadS [DescribeLocalGatewayRouteTables]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLocalGatewayRouteTables]
$creadListPrec :: ReadPrec [DescribeLocalGatewayRouteTables]
readPrec :: ReadPrec DescribeLocalGatewayRouteTables
$creadPrec :: ReadPrec DescribeLocalGatewayRouteTables
readList :: ReadS [DescribeLocalGatewayRouteTables]
$creadList :: ReadS [DescribeLocalGatewayRouteTables]
readsPrec :: Int -> ReadS DescribeLocalGatewayRouteTables
$creadsPrec :: Int -> ReadS DescribeLocalGatewayRouteTables
Prelude.Read, Int -> DescribeLocalGatewayRouteTables -> ShowS
[DescribeLocalGatewayRouteTables] -> ShowS
DescribeLocalGatewayRouteTables -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLocalGatewayRouteTables] -> ShowS
$cshowList :: [DescribeLocalGatewayRouteTables] -> ShowS
show :: DescribeLocalGatewayRouteTables -> String
$cshow :: DescribeLocalGatewayRouteTables -> String
showsPrec :: Int -> DescribeLocalGatewayRouteTables -> ShowS
$cshowsPrec :: Int -> DescribeLocalGatewayRouteTables -> ShowS
Prelude.Show, forall x.
Rep DescribeLocalGatewayRouteTables x
-> DescribeLocalGatewayRouteTables
forall x.
DescribeLocalGatewayRouteTables
-> Rep DescribeLocalGatewayRouteTables x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeLocalGatewayRouteTables x
-> DescribeLocalGatewayRouteTables
$cfrom :: forall x.
DescribeLocalGatewayRouteTables
-> Rep DescribeLocalGatewayRouteTables x
Prelude.Generic)

-- |
-- Create a value of 'DescribeLocalGatewayRouteTables' 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', 'describeLocalGatewayRouteTables_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', 'describeLocalGatewayRouteTables_filters' - One or more filters.
--
-- -   @local-gateway-id@ - The ID of a local gateway.
--
-- -   @local-gateway-route-table-arn@ - The Amazon Resource Name (ARN) of
--     the local gateway route table.
--
-- -   @local-gateway-route-table-id@ - The ID of a local gateway route
--     table.
--
-- -   @outpost-arn@ - The Amazon Resource Name (ARN) of the Outpost.
--
-- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
--     local gateway route table.
--
-- -   @state@ - The state of the local gateway route table.
--
-- 'localGatewayRouteTableIds', 'describeLocalGatewayRouteTables_localGatewayRouteTableIds' - The IDs of the local gateway route tables.
--
-- 'maxResults', 'describeLocalGatewayRouteTables_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', 'describeLocalGatewayRouteTables_nextToken' - The token for the next page of results.
newDescribeLocalGatewayRouteTables ::
  DescribeLocalGatewayRouteTables
newDescribeLocalGatewayRouteTables :: DescribeLocalGatewayRouteTables
newDescribeLocalGatewayRouteTables =
  DescribeLocalGatewayRouteTables'
    { $sel:dryRun:DescribeLocalGatewayRouteTables' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeLocalGatewayRouteTables' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:localGatewayRouteTableIds:DescribeLocalGatewayRouteTables' :: Maybe [Text]
localGatewayRouteTableIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeLocalGatewayRouteTables' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeLocalGatewayRouteTables' :: Maybe Text
nextToken = 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@.
describeLocalGatewayRouteTables_dryRun :: Lens.Lens' DescribeLocalGatewayRouteTables (Prelude.Maybe Prelude.Bool)
describeLocalGatewayRouteTables_dryRun :: Lens' DescribeLocalGatewayRouteTables (Maybe Bool)
describeLocalGatewayRouteTables_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocalGatewayRouteTables' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeLocalGatewayRouteTables' :: DescribeLocalGatewayRouteTables -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeLocalGatewayRouteTables
s@DescribeLocalGatewayRouteTables' {} Maybe Bool
a -> DescribeLocalGatewayRouteTables
s {$sel:dryRun:DescribeLocalGatewayRouteTables' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeLocalGatewayRouteTables)

-- | One or more filters.
--
-- -   @local-gateway-id@ - The ID of a local gateway.
--
-- -   @local-gateway-route-table-arn@ - The Amazon Resource Name (ARN) of
--     the local gateway route table.
--
-- -   @local-gateway-route-table-id@ - The ID of a local gateway route
--     table.
--
-- -   @outpost-arn@ - The Amazon Resource Name (ARN) of the Outpost.
--
-- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
--     local gateway route table.
--
-- -   @state@ - The state of the local gateway route table.
describeLocalGatewayRouteTables_filters :: Lens.Lens' DescribeLocalGatewayRouteTables (Prelude.Maybe [Filter])
describeLocalGatewayRouteTables_filters :: Lens' DescribeLocalGatewayRouteTables (Maybe [Filter])
describeLocalGatewayRouteTables_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocalGatewayRouteTables' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeLocalGatewayRouteTables' :: DescribeLocalGatewayRouteTables -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeLocalGatewayRouteTables
s@DescribeLocalGatewayRouteTables' {} Maybe [Filter]
a -> DescribeLocalGatewayRouteTables
s {$sel:filters:DescribeLocalGatewayRouteTables' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeLocalGatewayRouteTables) 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 IDs of the local gateway route tables.
describeLocalGatewayRouteTables_localGatewayRouteTableIds :: Lens.Lens' DescribeLocalGatewayRouteTables (Prelude.Maybe [Prelude.Text])
describeLocalGatewayRouteTables_localGatewayRouteTableIds :: Lens' DescribeLocalGatewayRouteTables (Maybe [Text])
describeLocalGatewayRouteTables_localGatewayRouteTableIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocalGatewayRouteTables' {Maybe [Text]
localGatewayRouteTableIds :: Maybe [Text]
$sel:localGatewayRouteTableIds:DescribeLocalGatewayRouteTables' :: DescribeLocalGatewayRouteTables -> Maybe [Text]
localGatewayRouteTableIds} -> Maybe [Text]
localGatewayRouteTableIds) (\s :: DescribeLocalGatewayRouteTables
s@DescribeLocalGatewayRouteTables' {} Maybe [Text]
a -> DescribeLocalGatewayRouteTables
s {$sel:localGatewayRouteTableIds:DescribeLocalGatewayRouteTables' :: Maybe [Text]
localGatewayRouteTableIds = Maybe [Text]
a} :: DescribeLocalGatewayRouteTables) 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.
describeLocalGatewayRouteTables_maxResults :: Lens.Lens' DescribeLocalGatewayRouteTables (Prelude.Maybe Prelude.Natural)
describeLocalGatewayRouteTables_maxResults :: Lens' DescribeLocalGatewayRouteTables (Maybe Natural)
describeLocalGatewayRouteTables_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocalGatewayRouteTables' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeLocalGatewayRouteTables' :: DescribeLocalGatewayRouteTables -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeLocalGatewayRouteTables
s@DescribeLocalGatewayRouteTables' {} Maybe Natural
a -> DescribeLocalGatewayRouteTables
s {$sel:maxResults:DescribeLocalGatewayRouteTables' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeLocalGatewayRouteTables)

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

instance
  Core.AWSPager
    DescribeLocalGatewayRouteTables
  where
  page :: DescribeLocalGatewayRouteTables
-> AWSResponse DescribeLocalGatewayRouteTables
-> Maybe DescribeLocalGatewayRouteTables
page DescribeLocalGatewayRouteTables
rq AWSResponse DescribeLocalGatewayRouteTables
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeLocalGatewayRouteTables
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeLocalGatewayRouteTablesResponse (Maybe Text)
describeLocalGatewayRouteTablesResponse_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 DescribeLocalGatewayRouteTables
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeLocalGatewayRouteTablesResponse
  (Maybe [LocalGatewayRouteTable])
describeLocalGatewayRouteTablesResponse_localGatewayRouteTables
            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.$ DescribeLocalGatewayRouteTables
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeLocalGatewayRouteTables (Maybe Text)
describeLocalGatewayRouteTables_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeLocalGatewayRouteTables
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeLocalGatewayRouteTablesResponse (Maybe Text)
describeLocalGatewayRouteTablesResponse_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
    DescribeLocalGatewayRouteTables
  where
  type
    AWSResponse DescribeLocalGatewayRouteTables =
      DescribeLocalGatewayRouteTablesResponse
  request :: (Service -> Service)
-> DescribeLocalGatewayRouteTables
-> Request DescribeLocalGatewayRouteTables
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 DescribeLocalGatewayRouteTables
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeLocalGatewayRouteTables)))
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 [LocalGatewayRouteTable]
-> Maybe Text -> Int -> DescribeLocalGatewayRouteTablesResponse
DescribeLocalGatewayRouteTablesResponse'
            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
"localGatewayRouteTableSet"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

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

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

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

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

instance Data.ToQuery DescribeLocalGatewayRouteTables where
  toQuery :: DescribeLocalGatewayRouteTables -> QueryString
toQuery DescribeLocalGatewayRouteTables' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
localGatewayRouteTableIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeLocalGatewayRouteTables' :: DescribeLocalGatewayRouteTables -> Maybe Text
$sel:maxResults:DescribeLocalGatewayRouteTables' :: DescribeLocalGatewayRouteTables -> Maybe Natural
$sel:localGatewayRouteTableIds:DescribeLocalGatewayRouteTables' :: DescribeLocalGatewayRouteTables -> Maybe [Text]
$sel:filters:DescribeLocalGatewayRouteTables' :: DescribeLocalGatewayRouteTables -> Maybe [Filter]
$sel:dryRun:DescribeLocalGatewayRouteTables' :: DescribeLocalGatewayRouteTables -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeLocalGatewayRouteTables" ::
                      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),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"LocalGatewayRouteTableId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
localGatewayRouteTableIds
          ),
        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
      ]

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

-- |
-- Create a value of 'DescribeLocalGatewayRouteTablesResponse' 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:
--
-- 'localGatewayRouteTables', 'describeLocalGatewayRouteTablesResponse_localGatewayRouteTables' - Information about the local gateway route tables.
--
-- 'nextToken', 'describeLocalGatewayRouteTablesResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'describeLocalGatewayRouteTablesResponse_httpStatus' - The response's http status code.
newDescribeLocalGatewayRouteTablesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeLocalGatewayRouteTablesResponse
newDescribeLocalGatewayRouteTablesResponse :: Int -> DescribeLocalGatewayRouteTablesResponse
newDescribeLocalGatewayRouteTablesResponse
  Int
pHttpStatus_ =
    DescribeLocalGatewayRouteTablesResponse'
      { $sel:localGatewayRouteTables:DescribeLocalGatewayRouteTablesResponse' :: Maybe [LocalGatewayRouteTable]
localGatewayRouteTables =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeLocalGatewayRouteTablesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeLocalGatewayRouteTablesResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Information about the local gateway route tables.
describeLocalGatewayRouteTablesResponse_localGatewayRouteTables :: Lens.Lens' DescribeLocalGatewayRouteTablesResponse (Prelude.Maybe [LocalGatewayRouteTable])
describeLocalGatewayRouteTablesResponse_localGatewayRouteTables :: Lens'
  DescribeLocalGatewayRouteTablesResponse
  (Maybe [LocalGatewayRouteTable])
describeLocalGatewayRouteTablesResponse_localGatewayRouteTables = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocalGatewayRouteTablesResponse' {Maybe [LocalGatewayRouteTable]
localGatewayRouteTables :: Maybe [LocalGatewayRouteTable]
$sel:localGatewayRouteTables:DescribeLocalGatewayRouteTablesResponse' :: DescribeLocalGatewayRouteTablesResponse
-> Maybe [LocalGatewayRouteTable]
localGatewayRouteTables} -> Maybe [LocalGatewayRouteTable]
localGatewayRouteTables) (\s :: DescribeLocalGatewayRouteTablesResponse
s@DescribeLocalGatewayRouteTablesResponse' {} Maybe [LocalGatewayRouteTable]
a -> DescribeLocalGatewayRouteTablesResponse
s {$sel:localGatewayRouteTables:DescribeLocalGatewayRouteTablesResponse' :: Maybe [LocalGatewayRouteTable]
localGatewayRouteTables = Maybe [LocalGatewayRouteTable]
a} :: DescribeLocalGatewayRouteTablesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance
  Prelude.NFData
    DescribeLocalGatewayRouteTablesResponse
  where
  rnf :: DescribeLocalGatewayRouteTablesResponse -> ()
rnf DescribeLocalGatewayRouteTablesResponse' {Int
Maybe [LocalGatewayRouteTable]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
localGatewayRouteTables :: Maybe [LocalGatewayRouteTable]
$sel:httpStatus:DescribeLocalGatewayRouteTablesResponse' :: DescribeLocalGatewayRouteTablesResponse -> Int
$sel:nextToken:DescribeLocalGatewayRouteTablesResponse' :: DescribeLocalGatewayRouteTablesResponse -> Maybe Text
$sel:localGatewayRouteTables:DescribeLocalGatewayRouteTablesResponse' :: DescribeLocalGatewayRouteTablesResponse
-> Maybe [LocalGatewayRouteTable]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [LocalGatewayRouteTable]
localGatewayRouteTables
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus