{-# 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.DescribeLocalGatewayRouteTableVpcAssociations
-- 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 the specified associations between VPCs and local gateway
-- route tables.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeLocalGatewayRouteTableVpcAssociations
  ( -- * Creating a Request
    DescribeLocalGatewayRouteTableVpcAssociations (..),
    newDescribeLocalGatewayRouteTableVpcAssociations,

    -- * Request Lenses
    describeLocalGatewayRouteTableVpcAssociations_dryRun,
    describeLocalGatewayRouteTableVpcAssociations_filters,
    describeLocalGatewayRouteTableVpcAssociations_localGatewayRouteTableVpcAssociationIds,
    describeLocalGatewayRouteTableVpcAssociations_maxResults,
    describeLocalGatewayRouteTableVpcAssociations_nextToken,

    -- * Destructuring the Response
    DescribeLocalGatewayRouteTableVpcAssociationsResponse (..),
    newDescribeLocalGatewayRouteTableVpcAssociationsResponse,

    -- * Response Lenses
    describeLocalGatewayRouteTableVpcAssociationsResponse_localGatewayRouteTableVpcAssociations,
    describeLocalGatewayRouteTableVpcAssociationsResponse_nextToken,
    describeLocalGatewayRouteTableVpcAssociationsResponse_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:/ 'newDescribeLocalGatewayRouteTableVpcAssociations' smart constructor.
data DescribeLocalGatewayRouteTableVpcAssociations = DescribeLocalGatewayRouteTableVpcAssociations'
  { -- | 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@.
    DescribeLocalGatewayRouteTableVpcAssociations -> 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 for the association.
    --
    -- -   @local-gateway-route-table-id@ - The ID of the local gateway route
    --     table.
    --
    -- -   @local-gateway-route-table-vpc-association-id@ - The ID of the
    --     association.
    --
    -- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
    --     local gateway route table for the association.
    --
    -- -   @state@ - The state of the association.
    --
    -- -   @vpc-id@ - The ID of the VPC.
    DescribeLocalGatewayRouteTableVpcAssociations -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The IDs of the associations.
    DescribeLocalGatewayRouteTableVpcAssociations -> Maybe [Text]
localGatewayRouteTableVpcAssociationIds :: 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.
    DescribeLocalGatewayRouteTableVpcAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    DescribeLocalGatewayRouteTableVpcAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeLocalGatewayRouteTableVpcAssociations
-> DescribeLocalGatewayRouteTableVpcAssociations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLocalGatewayRouteTableVpcAssociations
-> DescribeLocalGatewayRouteTableVpcAssociations -> Bool
$c/= :: DescribeLocalGatewayRouteTableVpcAssociations
-> DescribeLocalGatewayRouteTableVpcAssociations -> Bool
== :: DescribeLocalGatewayRouteTableVpcAssociations
-> DescribeLocalGatewayRouteTableVpcAssociations -> Bool
$c== :: DescribeLocalGatewayRouteTableVpcAssociations
-> DescribeLocalGatewayRouteTableVpcAssociations -> Bool
Prelude.Eq, ReadPrec [DescribeLocalGatewayRouteTableVpcAssociations]
ReadPrec DescribeLocalGatewayRouteTableVpcAssociations
Int -> ReadS DescribeLocalGatewayRouteTableVpcAssociations
ReadS [DescribeLocalGatewayRouteTableVpcAssociations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLocalGatewayRouteTableVpcAssociations]
$creadListPrec :: ReadPrec [DescribeLocalGatewayRouteTableVpcAssociations]
readPrec :: ReadPrec DescribeLocalGatewayRouteTableVpcAssociations
$creadPrec :: ReadPrec DescribeLocalGatewayRouteTableVpcAssociations
readList :: ReadS [DescribeLocalGatewayRouteTableVpcAssociations]
$creadList :: ReadS [DescribeLocalGatewayRouteTableVpcAssociations]
readsPrec :: Int -> ReadS DescribeLocalGatewayRouteTableVpcAssociations
$creadsPrec :: Int -> ReadS DescribeLocalGatewayRouteTableVpcAssociations
Prelude.Read, Int -> DescribeLocalGatewayRouteTableVpcAssociations -> ShowS
[DescribeLocalGatewayRouteTableVpcAssociations] -> ShowS
DescribeLocalGatewayRouteTableVpcAssociations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLocalGatewayRouteTableVpcAssociations] -> ShowS
$cshowList :: [DescribeLocalGatewayRouteTableVpcAssociations] -> ShowS
show :: DescribeLocalGatewayRouteTableVpcAssociations -> String
$cshow :: DescribeLocalGatewayRouteTableVpcAssociations -> String
showsPrec :: Int -> DescribeLocalGatewayRouteTableVpcAssociations -> ShowS
$cshowsPrec :: Int -> DescribeLocalGatewayRouteTableVpcAssociations -> ShowS
Prelude.Show, forall x.
Rep DescribeLocalGatewayRouteTableVpcAssociations x
-> DescribeLocalGatewayRouteTableVpcAssociations
forall x.
DescribeLocalGatewayRouteTableVpcAssociations
-> Rep DescribeLocalGatewayRouteTableVpcAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeLocalGatewayRouteTableVpcAssociations x
-> DescribeLocalGatewayRouteTableVpcAssociations
$cfrom :: forall x.
DescribeLocalGatewayRouteTableVpcAssociations
-> Rep DescribeLocalGatewayRouteTableVpcAssociations x
Prelude.Generic)

-- |
-- Create a value of 'DescribeLocalGatewayRouteTableVpcAssociations' 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', 'describeLocalGatewayRouteTableVpcAssociations_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', 'describeLocalGatewayRouteTableVpcAssociations_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 for the association.
--
-- -   @local-gateway-route-table-id@ - The ID of the local gateway route
--     table.
--
-- -   @local-gateway-route-table-vpc-association-id@ - The ID of the
--     association.
--
-- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
--     local gateway route table for the association.
--
-- -   @state@ - The state of the association.
--
-- -   @vpc-id@ - The ID of the VPC.
--
-- 'localGatewayRouteTableVpcAssociationIds', 'describeLocalGatewayRouteTableVpcAssociations_localGatewayRouteTableVpcAssociationIds' - The IDs of the associations.
--
-- 'maxResults', 'describeLocalGatewayRouteTableVpcAssociations_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', 'describeLocalGatewayRouteTableVpcAssociations_nextToken' - The token for the next page of results.
newDescribeLocalGatewayRouteTableVpcAssociations ::
  DescribeLocalGatewayRouteTableVpcAssociations
newDescribeLocalGatewayRouteTableVpcAssociations :: DescribeLocalGatewayRouteTableVpcAssociations
newDescribeLocalGatewayRouteTableVpcAssociations =
  DescribeLocalGatewayRouteTableVpcAssociations'
    { $sel:dryRun:DescribeLocalGatewayRouteTableVpcAssociations' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeLocalGatewayRouteTableVpcAssociations' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:localGatewayRouteTableVpcAssociationIds:DescribeLocalGatewayRouteTableVpcAssociations' :: Maybe [Text]
localGatewayRouteTableVpcAssociationIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeLocalGatewayRouteTableVpcAssociations' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeLocalGatewayRouteTableVpcAssociations' :: 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@.
describeLocalGatewayRouteTableVpcAssociations_dryRun :: Lens.Lens' DescribeLocalGatewayRouteTableVpcAssociations (Prelude.Maybe Prelude.Bool)
describeLocalGatewayRouteTableVpcAssociations_dryRun :: Lens' DescribeLocalGatewayRouteTableVpcAssociations (Maybe Bool)
describeLocalGatewayRouteTableVpcAssociations_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocalGatewayRouteTableVpcAssociations' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeLocalGatewayRouteTableVpcAssociations
s@DescribeLocalGatewayRouteTableVpcAssociations' {} Maybe Bool
a -> DescribeLocalGatewayRouteTableVpcAssociations
s {$sel:dryRun:DescribeLocalGatewayRouteTableVpcAssociations' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeLocalGatewayRouteTableVpcAssociations)

-- | 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 for the association.
--
-- -   @local-gateway-route-table-id@ - The ID of the local gateway route
--     table.
--
-- -   @local-gateway-route-table-vpc-association-id@ - The ID of the
--     association.
--
-- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
--     local gateway route table for the association.
--
-- -   @state@ - The state of the association.
--
-- -   @vpc-id@ - The ID of the VPC.
describeLocalGatewayRouteTableVpcAssociations_filters :: Lens.Lens' DescribeLocalGatewayRouteTableVpcAssociations (Prelude.Maybe [Filter])
describeLocalGatewayRouteTableVpcAssociations_filters :: Lens'
  DescribeLocalGatewayRouteTableVpcAssociations (Maybe [Filter])
describeLocalGatewayRouteTableVpcAssociations_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocalGatewayRouteTableVpcAssociations' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeLocalGatewayRouteTableVpcAssociations
s@DescribeLocalGatewayRouteTableVpcAssociations' {} Maybe [Filter]
a -> DescribeLocalGatewayRouteTableVpcAssociations
s {$sel:filters:DescribeLocalGatewayRouteTableVpcAssociations' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeLocalGatewayRouteTableVpcAssociations) 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 associations.
describeLocalGatewayRouteTableVpcAssociations_localGatewayRouteTableVpcAssociationIds :: Lens.Lens' DescribeLocalGatewayRouteTableVpcAssociations (Prelude.Maybe [Prelude.Text])
describeLocalGatewayRouteTableVpcAssociations_localGatewayRouteTableVpcAssociationIds :: Lens' DescribeLocalGatewayRouteTableVpcAssociations (Maybe [Text])
describeLocalGatewayRouteTableVpcAssociations_localGatewayRouteTableVpcAssociationIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocalGatewayRouteTableVpcAssociations' {Maybe [Text]
localGatewayRouteTableVpcAssociationIds :: Maybe [Text]
$sel:localGatewayRouteTableVpcAssociationIds:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe [Text]
localGatewayRouteTableVpcAssociationIds} -> Maybe [Text]
localGatewayRouteTableVpcAssociationIds) (\s :: DescribeLocalGatewayRouteTableVpcAssociations
s@DescribeLocalGatewayRouteTableVpcAssociations' {} Maybe [Text]
a -> DescribeLocalGatewayRouteTableVpcAssociations
s {$sel:localGatewayRouteTableVpcAssociationIds:DescribeLocalGatewayRouteTableVpcAssociations' :: Maybe [Text]
localGatewayRouteTableVpcAssociationIds = Maybe [Text]
a} :: DescribeLocalGatewayRouteTableVpcAssociations) 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.
describeLocalGatewayRouteTableVpcAssociations_maxResults :: Lens.Lens' DescribeLocalGatewayRouteTableVpcAssociations (Prelude.Maybe Prelude.Natural)
describeLocalGatewayRouteTableVpcAssociations_maxResults :: Lens' DescribeLocalGatewayRouteTableVpcAssociations (Maybe Natural)
describeLocalGatewayRouteTableVpcAssociations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocalGatewayRouteTableVpcAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeLocalGatewayRouteTableVpcAssociations
s@DescribeLocalGatewayRouteTableVpcAssociations' {} Maybe Natural
a -> DescribeLocalGatewayRouteTableVpcAssociations
s {$sel:maxResults:DescribeLocalGatewayRouteTableVpcAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeLocalGatewayRouteTableVpcAssociations)

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

instance
  Core.AWSPager
    DescribeLocalGatewayRouteTableVpcAssociations
  where
  page :: DescribeLocalGatewayRouteTableVpcAssociations
-> AWSResponse DescribeLocalGatewayRouteTableVpcAssociations
-> Maybe DescribeLocalGatewayRouteTableVpcAssociations
page DescribeLocalGatewayRouteTableVpcAssociations
rq AWSResponse DescribeLocalGatewayRouteTableVpcAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeLocalGatewayRouteTableVpcAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeLocalGatewayRouteTableVpcAssociationsResponse (Maybe Text)
describeLocalGatewayRouteTableVpcAssociationsResponse_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 DescribeLocalGatewayRouteTableVpcAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeLocalGatewayRouteTableVpcAssociationsResponse
  (Maybe [LocalGatewayRouteTableVpcAssociation])
describeLocalGatewayRouteTableVpcAssociationsResponse_localGatewayRouteTableVpcAssociations
            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.$ DescribeLocalGatewayRouteTableVpcAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeLocalGatewayRouteTableVpcAssociations (Maybe Text)
describeLocalGatewayRouteTableVpcAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeLocalGatewayRouteTableVpcAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeLocalGatewayRouteTableVpcAssociationsResponse (Maybe Text)
describeLocalGatewayRouteTableVpcAssociationsResponse_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
    DescribeLocalGatewayRouteTableVpcAssociations
  where
  type
    AWSResponse
      DescribeLocalGatewayRouteTableVpcAssociations =
      DescribeLocalGatewayRouteTableVpcAssociationsResponse
  request :: (Service -> Service)
-> DescribeLocalGatewayRouteTableVpcAssociations
-> Request DescribeLocalGatewayRouteTableVpcAssociations
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 DescribeLocalGatewayRouteTableVpcAssociations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeLocalGatewayRouteTableVpcAssociations)))
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 [LocalGatewayRouteTableVpcAssociation]
-> Maybe Text
-> Int
-> DescribeLocalGatewayRouteTableVpcAssociationsResponse
DescribeLocalGatewayRouteTableVpcAssociationsResponse'
            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
"localGatewayRouteTableVpcAssociationSet"
                            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
    DescribeLocalGatewayRouteTableVpcAssociations
  where
  hashWithSalt :: Int -> DescribeLocalGatewayRouteTableVpcAssociations -> Int
hashWithSalt
    Int
_salt
    DescribeLocalGatewayRouteTableVpcAssociations' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
localGatewayRouteTableVpcAssociationIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe Text
$sel:maxResults:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe Natural
$sel:localGatewayRouteTableVpcAssociationIds:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe [Text]
$sel:filters:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe [Filter]
$sel:dryRun:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> 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]
localGatewayRouteTableVpcAssociationIds
        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
    DescribeLocalGatewayRouteTableVpcAssociations
  where
  rnf :: DescribeLocalGatewayRouteTableVpcAssociations -> ()
rnf
    DescribeLocalGatewayRouteTableVpcAssociations' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
localGatewayRouteTableVpcAssociationIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe Text
$sel:maxResults:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe Natural
$sel:localGatewayRouteTableVpcAssociationIds:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe [Text]
$sel:filters:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe [Filter]
$sel:dryRun:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> 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]
localGatewayRouteTableVpcAssociationIds
        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
    DescribeLocalGatewayRouteTableVpcAssociations
  where
  toHeaders :: DescribeLocalGatewayRouteTableVpcAssociations -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance
  Data.ToQuery
    DescribeLocalGatewayRouteTableVpcAssociations
  where
  toQuery :: DescribeLocalGatewayRouteTableVpcAssociations -> QueryString
toQuery
    DescribeLocalGatewayRouteTableVpcAssociations' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
localGatewayRouteTableVpcAssociationIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe Text
$sel:maxResults:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe Natural
$sel:localGatewayRouteTableVpcAssociationIds:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe [Text]
$sel:filters:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe [Filter]
$sel:dryRun:DescribeLocalGatewayRouteTableVpcAssociations' :: DescribeLocalGatewayRouteTableVpcAssociations -> Maybe Bool
..} =
      forall a. Monoid a => [a] -> a
Prelude.mconcat
        [ ByteString
"Action"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeLocalGatewayRouteTableVpcAssociations" ::
                        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
"LocalGatewayRouteTableVpcAssociationId"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
localGatewayRouteTableVpcAssociationIds
            ),
          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:/ 'newDescribeLocalGatewayRouteTableVpcAssociationsResponse' smart constructor.
data DescribeLocalGatewayRouteTableVpcAssociationsResponse = DescribeLocalGatewayRouteTableVpcAssociationsResponse'
  { -- | Information about the associations.
    DescribeLocalGatewayRouteTableVpcAssociationsResponse
-> Maybe [LocalGatewayRouteTableVpcAssociation]
localGatewayRouteTableVpcAssociations :: Prelude.Maybe [LocalGatewayRouteTableVpcAssociation],
    -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    DescribeLocalGatewayRouteTableVpcAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeLocalGatewayRouteTableVpcAssociationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeLocalGatewayRouteTableVpcAssociationsResponse
-> DescribeLocalGatewayRouteTableVpcAssociationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLocalGatewayRouteTableVpcAssociationsResponse
-> DescribeLocalGatewayRouteTableVpcAssociationsResponse -> Bool
$c/= :: DescribeLocalGatewayRouteTableVpcAssociationsResponse
-> DescribeLocalGatewayRouteTableVpcAssociationsResponse -> Bool
== :: DescribeLocalGatewayRouteTableVpcAssociationsResponse
-> DescribeLocalGatewayRouteTableVpcAssociationsResponse -> Bool
$c== :: DescribeLocalGatewayRouteTableVpcAssociationsResponse
-> DescribeLocalGatewayRouteTableVpcAssociationsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeLocalGatewayRouteTableVpcAssociationsResponse]
ReadPrec DescribeLocalGatewayRouteTableVpcAssociationsResponse
Int -> ReadS DescribeLocalGatewayRouteTableVpcAssociationsResponse
ReadS [DescribeLocalGatewayRouteTableVpcAssociationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLocalGatewayRouteTableVpcAssociationsResponse]
$creadListPrec :: ReadPrec [DescribeLocalGatewayRouteTableVpcAssociationsResponse]
readPrec :: ReadPrec DescribeLocalGatewayRouteTableVpcAssociationsResponse
$creadPrec :: ReadPrec DescribeLocalGatewayRouteTableVpcAssociationsResponse
readList :: ReadS [DescribeLocalGatewayRouteTableVpcAssociationsResponse]
$creadList :: ReadS [DescribeLocalGatewayRouteTableVpcAssociationsResponse]
readsPrec :: Int -> ReadS DescribeLocalGatewayRouteTableVpcAssociationsResponse
$creadsPrec :: Int -> ReadS DescribeLocalGatewayRouteTableVpcAssociationsResponse
Prelude.Read, Int
-> DescribeLocalGatewayRouteTableVpcAssociationsResponse -> ShowS
[DescribeLocalGatewayRouteTableVpcAssociationsResponse] -> ShowS
DescribeLocalGatewayRouteTableVpcAssociationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLocalGatewayRouteTableVpcAssociationsResponse] -> ShowS
$cshowList :: [DescribeLocalGatewayRouteTableVpcAssociationsResponse] -> ShowS
show :: DescribeLocalGatewayRouteTableVpcAssociationsResponse -> String
$cshow :: DescribeLocalGatewayRouteTableVpcAssociationsResponse -> String
showsPrec :: Int
-> DescribeLocalGatewayRouteTableVpcAssociationsResponse -> ShowS
$cshowsPrec :: Int
-> DescribeLocalGatewayRouteTableVpcAssociationsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeLocalGatewayRouteTableVpcAssociationsResponse x
-> DescribeLocalGatewayRouteTableVpcAssociationsResponse
forall x.
DescribeLocalGatewayRouteTableVpcAssociationsResponse
-> Rep DescribeLocalGatewayRouteTableVpcAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeLocalGatewayRouteTableVpcAssociationsResponse x
-> DescribeLocalGatewayRouteTableVpcAssociationsResponse
$cfrom :: forall x.
DescribeLocalGatewayRouteTableVpcAssociationsResponse
-> Rep DescribeLocalGatewayRouteTableVpcAssociationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeLocalGatewayRouteTableVpcAssociationsResponse' 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:
--
-- 'localGatewayRouteTableVpcAssociations', 'describeLocalGatewayRouteTableVpcAssociationsResponse_localGatewayRouteTableVpcAssociations' - Information about the associations.
--
-- 'nextToken', 'describeLocalGatewayRouteTableVpcAssociationsResponse_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', 'describeLocalGatewayRouteTableVpcAssociationsResponse_httpStatus' - The response's http status code.
newDescribeLocalGatewayRouteTableVpcAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeLocalGatewayRouteTableVpcAssociationsResponse
newDescribeLocalGatewayRouteTableVpcAssociationsResponse :: Int -> DescribeLocalGatewayRouteTableVpcAssociationsResponse
newDescribeLocalGatewayRouteTableVpcAssociationsResponse
  Int
pHttpStatus_ =
    DescribeLocalGatewayRouteTableVpcAssociationsResponse'
      { $sel:localGatewayRouteTableVpcAssociations:DescribeLocalGatewayRouteTableVpcAssociationsResponse' :: Maybe [LocalGatewayRouteTableVpcAssociation]
localGatewayRouteTableVpcAssociations =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeLocalGatewayRouteTableVpcAssociationsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeLocalGatewayRouteTableVpcAssociationsResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | Information about the associations.
describeLocalGatewayRouteTableVpcAssociationsResponse_localGatewayRouteTableVpcAssociations :: Lens.Lens' DescribeLocalGatewayRouteTableVpcAssociationsResponse (Prelude.Maybe [LocalGatewayRouteTableVpcAssociation])
describeLocalGatewayRouteTableVpcAssociationsResponse_localGatewayRouteTableVpcAssociations :: Lens'
  DescribeLocalGatewayRouteTableVpcAssociationsResponse
  (Maybe [LocalGatewayRouteTableVpcAssociation])
describeLocalGatewayRouteTableVpcAssociationsResponse_localGatewayRouteTableVpcAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocalGatewayRouteTableVpcAssociationsResponse' {Maybe [LocalGatewayRouteTableVpcAssociation]
localGatewayRouteTableVpcAssociations :: Maybe [LocalGatewayRouteTableVpcAssociation]
$sel:localGatewayRouteTableVpcAssociations:DescribeLocalGatewayRouteTableVpcAssociationsResponse' :: DescribeLocalGatewayRouteTableVpcAssociationsResponse
-> Maybe [LocalGatewayRouteTableVpcAssociation]
localGatewayRouteTableVpcAssociations} -> Maybe [LocalGatewayRouteTableVpcAssociation]
localGatewayRouteTableVpcAssociations) (\s :: DescribeLocalGatewayRouteTableVpcAssociationsResponse
s@DescribeLocalGatewayRouteTableVpcAssociationsResponse' {} Maybe [LocalGatewayRouteTableVpcAssociation]
a -> DescribeLocalGatewayRouteTableVpcAssociationsResponse
s {$sel:localGatewayRouteTableVpcAssociations:DescribeLocalGatewayRouteTableVpcAssociationsResponse' :: Maybe [LocalGatewayRouteTableVpcAssociation]
localGatewayRouteTableVpcAssociations = Maybe [LocalGatewayRouteTableVpcAssociation]
a} :: DescribeLocalGatewayRouteTableVpcAssociationsResponse) 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.
describeLocalGatewayRouteTableVpcAssociationsResponse_nextToken :: Lens.Lens' DescribeLocalGatewayRouteTableVpcAssociationsResponse (Prelude.Maybe Prelude.Text)
describeLocalGatewayRouteTableVpcAssociationsResponse_nextToken :: Lens'
  DescribeLocalGatewayRouteTableVpcAssociationsResponse (Maybe Text)
describeLocalGatewayRouteTableVpcAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocalGatewayRouteTableVpcAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeLocalGatewayRouteTableVpcAssociationsResponse' :: DescribeLocalGatewayRouteTableVpcAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeLocalGatewayRouteTableVpcAssociationsResponse
s@DescribeLocalGatewayRouteTableVpcAssociationsResponse' {} Maybe Text
a -> DescribeLocalGatewayRouteTableVpcAssociationsResponse
s {$sel:nextToken:DescribeLocalGatewayRouteTableVpcAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeLocalGatewayRouteTableVpcAssociationsResponse)

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

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