{-# 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.GetTransitGatewayRouteTablePropagations
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets information about the route table propagations for the specified
-- transit gateway route table.
--
-- This operation returns paginated results.
module Amazonka.EC2.GetTransitGatewayRouteTablePropagations
  ( -- * Creating a Request
    GetTransitGatewayRouteTablePropagations (..),
    newGetTransitGatewayRouteTablePropagations,

    -- * Request Lenses
    getTransitGatewayRouteTablePropagations_dryRun,
    getTransitGatewayRouteTablePropagations_filters,
    getTransitGatewayRouteTablePropagations_maxResults,
    getTransitGatewayRouteTablePropagations_nextToken,
    getTransitGatewayRouteTablePropagations_transitGatewayRouteTableId,

    -- * Destructuring the Response
    GetTransitGatewayRouteTablePropagationsResponse (..),
    newGetTransitGatewayRouteTablePropagationsResponse,

    -- * Response Lenses
    getTransitGatewayRouteTablePropagationsResponse_nextToken,
    getTransitGatewayRouteTablePropagationsResponse_transitGatewayRouteTablePropagations,
    getTransitGatewayRouteTablePropagationsResponse_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:/ 'newGetTransitGatewayRouteTablePropagations' smart constructor.
data GetTransitGatewayRouteTablePropagations = GetTransitGatewayRouteTablePropagations'
  { -- | 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@.
    GetTransitGatewayRouteTablePropagations -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters. The possible values are:
    --
    -- -   @resource-id@ - The ID of the resource.
    --
    -- -   @resource-type@ - The resource type. Valid values are @vpc@ | @vpn@
    --     | @direct-connect-gateway@ | @peering@ | @connect@.
    --
    -- -   @transit-gateway-attachment-id@ - The ID of the attachment.
    GetTransitGatewayRouteTablePropagations -> 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.
    GetTransitGatewayRouteTablePropagations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    GetTransitGatewayRouteTablePropagations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the transit gateway route table.
    GetTransitGatewayRouteTablePropagations -> Text
transitGatewayRouteTableId :: Prelude.Text
  }
  deriving (GetTransitGatewayRouteTablePropagations
-> GetTransitGatewayRouteTablePropagations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTransitGatewayRouteTablePropagations
-> GetTransitGatewayRouteTablePropagations -> Bool
$c/= :: GetTransitGatewayRouteTablePropagations
-> GetTransitGatewayRouteTablePropagations -> Bool
== :: GetTransitGatewayRouteTablePropagations
-> GetTransitGatewayRouteTablePropagations -> Bool
$c== :: GetTransitGatewayRouteTablePropagations
-> GetTransitGatewayRouteTablePropagations -> Bool
Prelude.Eq, ReadPrec [GetTransitGatewayRouteTablePropagations]
ReadPrec GetTransitGatewayRouteTablePropagations
Int -> ReadS GetTransitGatewayRouteTablePropagations
ReadS [GetTransitGatewayRouteTablePropagations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTransitGatewayRouteTablePropagations]
$creadListPrec :: ReadPrec [GetTransitGatewayRouteTablePropagations]
readPrec :: ReadPrec GetTransitGatewayRouteTablePropagations
$creadPrec :: ReadPrec GetTransitGatewayRouteTablePropagations
readList :: ReadS [GetTransitGatewayRouteTablePropagations]
$creadList :: ReadS [GetTransitGatewayRouteTablePropagations]
readsPrec :: Int -> ReadS GetTransitGatewayRouteTablePropagations
$creadsPrec :: Int -> ReadS GetTransitGatewayRouteTablePropagations
Prelude.Read, Int -> GetTransitGatewayRouteTablePropagations -> ShowS
[GetTransitGatewayRouteTablePropagations] -> ShowS
GetTransitGatewayRouteTablePropagations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTransitGatewayRouteTablePropagations] -> ShowS
$cshowList :: [GetTransitGatewayRouteTablePropagations] -> ShowS
show :: GetTransitGatewayRouteTablePropagations -> String
$cshow :: GetTransitGatewayRouteTablePropagations -> String
showsPrec :: Int -> GetTransitGatewayRouteTablePropagations -> ShowS
$cshowsPrec :: Int -> GetTransitGatewayRouteTablePropagations -> ShowS
Prelude.Show, forall x.
Rep GetTransitGatewayRouteTablePropagations x
-> GetTransitGatewayRouteTablePropagations
forall x.
GetTransitGatewayRouteTablePropagations
-> Rep GetTransitGatewayRouteTablePropagations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTransitGatewayRouteTablePropagations x
-> GetTransitGatewayRouteTablePropagations
$cfrom :: forall x.
GetTransitGatewayRouteTablePropagations
-> Rep GetTransitGatewayRouteTablePropagations x
Prelude.Generic)

-- |
-- Create a value of 'GetTransitGatewayRouteTablePropagations' 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', 'getTransitGatewayRouteTablePropagations_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', 'getTransitGatewayRouteTablePropagations_filters' - One or more filters. The possible values are:
--
-- -   @resource-id@ - The ID of the resource.
--
-- -   @resource-type@ - The resource type. Valid values are @vpc@ | @vpn@
--     | @direct-connect-gateway@ | @peering@ | @connect@.
--
-- -   @transit-gateway-attachment-id@ - The ID of the attachment.
--
-- 'maxResults', 'getTransitGatewayRouteTablePropagations_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', 'getTransitGatewayRouteTablePropagations_nextToken' - The token for the next page of results.
--
-- 'transitGatewayRouteTableId', 'getTransitGatewayRouteTablePropagations_transitGatewayRouteTableId' - The ID of the transit gateway route table.
newGetTransitGatewayRouteTablePropagations ::
  -- | 'transitGatewayRouteTableId'
  Prelude.Text ->
  GetTransitGatewayRouteTablePropagations
newGetTransitGatewayRouteTablePropagations :: Text -> GetTransitGatewayRouteTablePropagations
newGetTransitGatewayRouteTablePropagations
  Text
pTransitGatewayRouteTableId_ =
    GetTransitGatewayRouteTablePropagations'
      { $sel:dryRun:GetTransitGatewayRouteTablePropagations' :: Maybe Bool
dryRun =
          forall a. Maybe a
Prelude.Nothing,
        $sel:filters:GetTransitGatewayRouteTablePropagations' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:GetTransitGatewayRouteTablePropagations' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetTransitGatewayRouteTablePropagations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayRouteTableId:GetTransitGatewayRouteTablePropagations' :: Text
transitGatewayRouteTableId =
          Text
pTransitGatewayRouteTableId_
      }

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

-- | One or more filters. The possible values are:
--
-- -   @resource-id@ - The ID of the resource.
--
-- -   @resource-type@ - The resource type. Valid values are @vpc@ | @vpn@
--     | @direct-connect-gateway@ | @peering@ | @connect@.
--
-- -   @transit-gateway-attachment-id@ - The ID of the attachment.
getTransitGatewayRouteTablePropagations_filters :: Lens.Lens' GetTransitGatewayRouteTablePropagations (Prelude.Maybe [Filter])
getTransitGatewayRouteTablePropagations_filters :: Lens' GetTransitGatewayRouteTablePropagations (Maybe [Filter])
getTransitGatewayRouteTablePropagations_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayRouteTablePropagations' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:GetTransitGatewayRouteTablePropagations' :: GetTransitGatewayRouteTablePropagations -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: GetTransitGatewayRouteTablePropagations
s@GetTransitGatewayRouteTablePropagations' {} Maybe [Filter]
a -> GetTransitGatewayRouteTablePropagations
s {$sel:filters:GetTransitGatewayRouteTablePropagations' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: GetTransitGatewayRouteTablePropagations) 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.
getTransitGatewayRouteTablePropagations_maxResults :: Lens.Lens' GetTransitGatewayRouteTablePropagations (Prelude.Maybe Prelude.Natural)
getTransitGatewayRouteTablePropagations_maxResults :: Lens' GetTransitGatewayRouteTablePropagations (Maybe Natural)
getTransitGatewayRouteTablePropagations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayRouteTablePropagations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetTransitGatewayRouteTablePropagations' :: GetTransitGatewayRouteTablePropagations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetTransitGatewayRouteTablePropagations
s@GetTransitGatewayRouteTablePropagations' {} Maybe Natural
a -> GetTransitGatewayRouteTablePropagations
s {$sel:maxResults:GetTransitGatewayRouteTablePropagations' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetTransitGatewayRouteTablePropagations)

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

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

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

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

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

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

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

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

-- |
-- Create a value of 'GetTransitGatewayRouteTablePropagationsResponse' 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', 'getTransitGatewayRouteTablePropagationsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'transitGatewayRouteTablePropagations', 'getTransitGatewayRouteTablePropagationsResponse_transitGatewayRouteTablePropagations' - Information about the route table propagations.
--
-- 'httpStatus', 'getTransitGatewayRouteTablePropagationsResponse_httpStatus' - The response's http status code.
newGetTransitGatewayRouteTablePropagationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTransitGatewayRouteTablePropagationsResponse
newGetTransitGatewayRouteTablePropagationsResponse :: Int -> GetTransitGatewayRouteTablePropagationsResponse
newGetTransitGatewayRouteTablePropagationsResponse
  Int
pHttpStatus_ =
    GetTransitGatewayRouteTablePropagationsResponse'
      { $sel:nextToken:GetTransitGatewayRouteTablePropagationsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayRouteTablePropagations:GetTransitGatewayRouteTablePropagationsResponse' :: Maybe [TransitGatewayRouteTablePropagation]
transitGatewayRouteTablePropagations =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetTransitGatewayRouteTablePropagationsResponse' :: 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.
getTransitGatewayRouteTablePropagationsResponse_nextToken :: Lens.Lens' GetTransitGatewayRouteTablePropagationsResponse (Prelude.Maybe Prelude.Text)
getTransitGatewayRouteTablePropagationsResponse_nextToken :: Lens' GetTransitGatewayRouteTablePropagationsResponse (Maybe Text)
getTransitGatewayRouteTablePropagationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayRouteTablePropagationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTransitGatewayRouteTablePropagationsResponse' :: GetTransitGatewayRouteTablePropagationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTransitGatewayRouteTablePropagationsResponse
s@GetTransitGatewayRouteTablePropagationsResponse' {} Maybe Text
a -> GetTransitGatewayRouteTablePropagationsResponse
s {$sel:nextToken:GetTransitGatewayRouteTablePropagationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetTransitGatewayRouteTablePropagationsResponse)

-- | Information about the route table propagations.
getTransitGatewayRouteTablePropagationsResponse_transitGatewayRouteTablePropagations :: Lens.Lens' GetTransitGatewayRouteTablePropagationsResponse (Prelude.Maybe [TransitGatewayRouteTablePropagation])
getTransitGatewayRouteTablePropagationsResponse_transitGatewayRouteTablePropagations :: Lens'
  GetTransitGatewayRouteTablePropagationsResponse
  (Maybe [TransitGatewayRouteTablePropagation])
getTransitGatewayRouteTablePropagationsResponse_transitGatewayRouteTablePropagations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayRouteTablePropagationsResponse' {Maybe [TransitGatewayRouteTablePropagation]
transitGatewayRouteTablePropagations :: Maybe [TransitGatewayRouteTablePropagation]
$sel:transitGatewayRouteTablePropagations:GetTransitGatewayRouteTablePropagationsResponse' :: GetTransitGatewayRouteTablePropagationsResponse
-> Maybe [TransitGatewayRouteTablePropagation]
transitGatewayRouteTablePropagations} -> Maybe [TransitGatewayRouteTablePropagation]
transitGatewayRouteTablePropagations) (\s :: GetTransitGatewayRouteTablePropagationsResponse
s@GetTransitGatewayRouteTablePropagationsResponse' {} Maybe [TransitGatewayRouteTablePropagation]
a -> GetTransitGatewayRouteTablePropagationsResponse
s {$sel:transitGatewayRouteTablePropagations:GetTransitGatewayRouteTablePropagationsResponse' :: Maybe [TransitGatewayRouteTablePropagation]
transitGatewayRouteTablePropagations = Maybe [TransitGatewayRouteTablePropagation]
a} :: GetTransitGatewayRouteTablePropagationsResponse) 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.
getTransitGatewayRouteTablePropagationsResponse_httpStatus :: Lens.Lens' GetTransitGatewayRouteTablePropagationsResponse Prelude.Int
getTransitGatewayRouteTablePropagationsResponse_httpStatus :: Lens' GetTransitGatewayRouteTablePropagationsResponse Int
getTransitGatewayRouteTablePropagationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayRouteTablePropagationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetTransitGatewayRouteTablePropagationsResponse' :: GetTransitGatewayRouteTablePropagationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetTransitGatewayRouteTablePropagationsResponse
s@GetTransitGatewayRouteTablePropagationsResponse' {} Int
a -> GetTransitGatewayRouteTablePropagationsResponse
s {$sel:httpStatus:GetTransitGatewayRouteTablePropagationsResponse' :: Int
httpStatus = Int
a} :: GetTransitGatewayRouteTablePropagationsResponse)

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