{-# 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.SearchTransitGatewayRoutes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Searches for routes in the specified transit gateway route table.
module Amazonka.EC2.SearchTransitGatewayRoutes
  ( -- * Creating a Request
    SearchTransitGatewayRoutes (..),
    newSearchTransitGatewayRoutes,

    -- * Request Lenses
    searchTransitGatewayRoutes_dryRun,
    searchTransitGatewayRoutes_maxResults,
    searchTransitGatewayRoutes_transitGatewayRouteTableId,
    searchTransitGatewayRoutes_filters,

    -- * Destructuring the Response
    SearchTransitGatewayRoutesResponse (..),
    newSearchTransitGatewayRoutesResponse,

    -- * Response Lenses
    searchTransitGatewayRoutesResponse_additionalRoutesAvailable,
    searchTransitGatewayRoutesResponse_routes,
    searchTransitGatewayRoutesResponse_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:/ 'newSearchTransitGatewayRoutes' smart constructor.
data SearchTransitGatewayRoutes = SearchTransitGatewayRoutes'
  { -- | 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@.
    SearchTransitGatewayRoutes -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The maximum number of routes to return.
    SearchTransitGatewayRoutes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the transit gateway route table.
    SearchTransitGatewayRoutes -> Text
transitGatewayRouteTableId :: Prelude.Text,
    -- | One or more filters. The possible values are:
    --
    -- -   @attachment.transit-gateway-attachment-id@- The id of the transit
    --     gateway attachment.
    --
    -- -   @attachment.resource-id@ - The resource id of the transit gateway
    --     attachment.
    --
    -- -   @attachment.resource-type@ - The attachment resource type. Valid
    --     values are @vpc@ | @vpn@ | @direct-connect-gateway@ | @peering@ |
    --     @connect@.
    --
    -- -   @prefix-list-id@ - The ID of the prefix list.
    --
    -- -   @route-search.exact-match@ - The exact match of the specified
    --     filter.
    --
    -- -   @route-search.longest-prefix-match@ - The longest prefix that
    --     matches the route.
    --
    -- -   @route-search.subnet-of-match@ - The routes with a subnet that match
    --     the specified CIDR filter.
    --
    -- -   @route-search.supernet-of-match@ - The routes with a CIDR that
    --     encompass the CIDR filter. For example, if you have 10.0.1.0\/29 and
    --     10.0.1.0\/31 routes in your route table and you specify
    --     supernet-of-match as 10.0.1.0\/30, then the result returns
    --     10.0.1.0\/29.
    --
    -- -   @state@ - The state of the route (@active@ | @blackhole@).
    --
    -- -   @type@ - The type of route (@propagated@ | @static@).
    SearchTransitGatewayRoutes -> [Filter]
filters :: [Filter]
  }
  deriving (SearchTransitGatewayRoutes -> SearchTransitGatewayRoutes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchTransitGatewayRoutes -> SearchTransitGatewayRoutes -> Bool
$c/= :: SearchTransitGatewayRoutes -> SearchTransitGatewayRoutes -> Bool
== :: SearchTransitGatewayRoutes -> SearchTransitGatewayRoutes -> Bool
$c== :: SearchTransitGatewayRoutes -> SearchTransitGatewayRoutes -> Bool
Prelude.Eq, ReadPrec [SearchTransitGatewayRoutes]
ReadPrec SearchTransitGatewayRoutes
Int -> ReadS SearchTransitGatewayRoutes
ReadS [SearchTransitGatewayRoutes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchTransitGatewayRoutes]
$creadListPrec :: ReadPrec [SearchTransitGatewayRoutes]
readPrec :: ReadPrec SearchTransitGatewayRoutes
$creadPrec :: ReadPrec SearchTransitGatewayRoutes
readList :: ReadS [SearchTransitGatewayRoutes]
$creadList :: ReadS [SearchTransitGatewayRoutes]
readsPrec :: Int -> ReadS SearchTransitGatewayRoutes
$creadsPrec :: Int -> ReadS SearchTransitGatewayRoutes
Prelude.Read, Int -> SearchTransitGatewayRoutes -> ShowS
[SearchTransitGatewayRoutes] -> ShowS
SearchTransitGatewayRoutes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchTransitGatewayRoutes] -> ShowS
$cshowList :: [SearchTransitGatewayRoutes] -> ShowS
show :: SearchTransitGatewayRoutes -> String
$cshow :: SearchTransitGatewayRoutes -> String
showsPrec :: Int -> SearchTransitGatewayRoutes -> ShowS
$cshowsPrec :: Int -> SearchTransitGatewayRoutes -> ShowS
Prelude.Show, forall x.
Rep SearchTransitGatewayRoutes x -> SearchTransitGatewayRoutes
forall x.
SearchTransitGatewayRoutes -> Rep SearchTransitGatewayRoutes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchTransitGatewayRoutes x -> SearchTransitGatewayRoutes
$cfrom :: forall x.
SearchTransitGatewayRoutes -> Rep SearchTransitGatewayRoutes x
Prelude.Generic)

-- |
-- Create a value of 'SearchTransitGatewayRoutes' 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', 'searchTransitGatewayRoutes_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@.
--
-- 'maxResults', 'searchTransitGatewayRoutes_maxResults' - The maximum number of routes to return.
--
-- 'transitGatewayRouteTableId', 'searchTransitGatewayRoutes_transitGatewayRouteTableId' - The ID of the transit gateway route table.
--
-- 'filters', 'searchTransitGatewayRoutes_filters' - One or more filters. The possible values are:
--
-- -   @attachment.transit-gateway-attachment-id@- The id of the transit
--     gateway attachment.
--
-- -   @attachment.resource-id@ - The resource id of the transit gateway
--     attachment.
--
-- -   @attachment.resource-type@ - The attachment resource type. Valid
--     values are @vpc@ | @vpn@ | @direct-connect-gateway@ | @peering@ |
--     @connect@.
--
-- -   @prefix-list-id@ - The ID of the prefix list.
--
-- -   @route-search.exact-match@ - The exact match of the specified
--     filter.
--
-- -   @route-search.longest-prefix-match@ - The longest prefix that
--     matches the route.
--
-- -   @route-search.subnet-of-match@ - The routes with a subnet that match
--     the specified CIDR filter.
--
-- -   @route-search.supernet-of-match@ - The routes with a CIDR that
--     encompass the CIDR filter. For example, if you have 10.0.1.0\/29 and
--     10.0.1.0\/31 routes in your route table and you specify
--     supernet-of-match as 10.0.1.0\/30, then the result returns
--     10.0.1.0\/29.
--
-- -   @state@ - The state of the route (@active@ | @blackhole@).
--
-- -   @type@ - The type of route (@propagated@ | @static@).
newSearchTransitGatewayRoutes ::
  -- | 'transitGatewayRouteTableId'
  Prelude.Text ->
  SearchTransitGatewayRoutes
newSearchTransitGatewayRoutes :: Text -> SearchTransitGatewayRoutes
newSearchTransitGatewayRoutes
  Text
pTransitGatewayRouteTableId_ =
    SearchTransitGatewayRoutes'
      { $sel:dryRun:SearchTransitGatewayRoutes' :: Maybe Bool
dryRun =
          forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:SearchTransitGatewayRoutes' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayRouteTableId:SearchTransitGatewayRoutes' :: Text
transitGatewayRouteTableId =
          Text
pTransitGatewayRouteTableId_,
        $sel:filters:SearchTransitGatewayRoutes' :: [Filter]
filters = forall a. Monoid a => a
Prelude.mempty
      }

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

-- | The maximum number of routes to return.
searchTransitGatewayRoutes_maxResults :: Lens.Lens' SearchTransitGatewayRoutes (Prelude.Maybe Prelude.Natural)
searchTransitGatewayRoutes_maxResults :: Lens' SearchTransitGatewayRoutes (Maybe Natural)
searchTransitGatewayRoutes_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTransitGatewayRoutes' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: SearchTransitGatewayRoutes
s@SearchTransitGatewayRoutes' {} Maybe Natural
a -> SearchTransitGatewayRoutes
s {$sel:maxResults:SearchTransitGatewayRoutes' :: Maybe Natural
maxResults = Maybe Natural
a} :: SearchTransitGatewayRoutes)

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

-- | One or more filters. The possible values are:
--
-- -   @attachment.transit-gateway-attachment-id@- The id of the transit
--     gateway attachment.
--
-- -   @attachment.resource-id@ - The resource id of the transit gateway
--     attachment.
--
-- -   @attachment.resource-type@ - The attachment resource type. Valid
--     values are @vpc@ | @vpn@ | @direct-connect-gateway@ | @peering@ |
--     @connect@.
--
-- -   @prefix-list-id@ - The ID of the prefix list.
--
-- -   @route-search.exact-match@ - The exact match of the specified
--     filter.
--
-- -   @route-search.longest-prefix-match@ - The longest prefix that
--     matches the route.
--
-- -   @route-search.subnet-of-match@ - The routes with a subnet that match
--     the specified CIDR filter.
--
-- -   @route-search.supernet-of-match@ - The routes with a CIDR that
--     encompass the CIDR filter. For example, if you have 10.0.1.0\/29 and
--     10.0.1.0\/31 routes in your route table and you specify
--     supernet-of-match as 10.0.1.0\/30, then the result returns
--     10.0.1.0\/29.
--
-- -   @state@ - The state of the route (@active@ | @blackhole@).
--
-- -   @type@ - The type of route (@propagated@ | @static@).
searchTransitGatewayRoutes_filters :: Lens.Lens' SearchTransitGatewayRoutes [Filter]
searchTransitGatewayRoutes_filters :: Lens' SearchTransitGatewayRoutes [Filter]
searchTransitGatewayRoutes_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTransitGatewayRoutes' {[Filter]
filters :: [Filter]
$sel:filters:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> [Filter]
filters} -> [Filter]
filters) (\s :: SearchTransitGatewayRoutes
s@SearchTransitGatewayRoutes' {} [Filter]
a -> SearchTransitGatewayRoutes
s {$sel:filters:SearchTransitGatewayRoutes' :: [Filter]
filters = [Filter]
a} :: SearchTransitGatewayRoutes) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest SearchTransitGatewayRoutes where
  type
    AWSResponse SearchTransitGatewayRoutes =
      SearchTransitGatewayRoutesResponse
  request :: (Service -> Service)
-> SearchTransitGatewayRoutes -> Request SearchTransitGatewayRoutes
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 SearchTransitGatewayRoutes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SearchTransitGatewayRoutes)))
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 Bool
-> Maybe [TransitGatewayRoute]
-> Int
-> SearchTransitGatewayRoutesResponse
SearchTransitGatewayRoutesResponse'
            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
"additionalRoutesAvailable")
            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
"routeSet"
                            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 SearchTransitGatewayRoutes where
  hashWithSalt :: Int -> SearchTransitGatewayRoutes -> Int
hashWithSalt Int
_salt SearchTransitGatewayRoutes' {[Filter]
Maybe Bool
Maybe Natural
Text
filters :: [Filter]
transitGatewayRouteTableId :: Text
maxResults :: Maybe Natural
dryRun :: Maybe Bool
$sel:filters:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> [Filter]
$sel:transitGatewayRouteTableId:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> Text
$sel:maxResults:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> Maybe Natural
$sel:dryRun:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> 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 Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
transitGatewayRouteTableId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Filter]
filters

instance Prelude.NFData SearchTransitGatewayRoutes where
  rnf :: SearchTransitGatewayRoutes -> ()
rnf SearchTransitGatewayRoutes' {[Filter]
Maybe Bool
Maybe Natural
Text
filters :: [Filter]
transitGatewayRouteTableId :: Text
maxResults :: Maybe Natural
dryRun :: Maybe Bool
$sel:filters:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> [Filter]
$sel:transitGatewayRouteTableId:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> Text
$sel:maxResults:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> Maybe Natural
$sel:dryRun:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> 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 Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
transitGatewayRouteTableId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Filter]
filters

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

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

instance Data.ToQuery SearchTransitGatewayRoutes where
  toQuery :: SearchTransitGatewayRoutes -> QueryString
toQuery SearchTransitGatewayRoutes' {[Filter]
Maybe Bool
Maybe Natural
Text
filters :: [Filter]
transitGatewayRouteTableId :: Text
maxResults :: Maybe Natural
dryRun :: Maybe Bool
$sel:filters:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> [Filter]
$sel:transitGatewayRouteTableId:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> Text
$sel:maxResults:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> Maybe Natural
$sel:dryRun:SearchTransitGatewayRoutes' :: SearchTransitGatewayRoutes -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"SearchTransitGatewayRoutes" :: 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,
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"TransitGatewayRouteTableId"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
transitGatewayRouteTableId,
        forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" [Filter]
filters
      ]

-- | /See:/ 'newSearchTransitGatewayRoutesResponse' smart constructor.
data SearchTransitGatewayRoutesResponse = SearchTransitGatewayRoutesResponse'
  { -- | Indicates whether there are additional routes available.
    SearchTransitGatewayRoutesResponse -> Maybe Bool
additionalRoutesAvailable :: Prelude.Maybe Prelude.Bool,
    -- | Information about the routes.
    SearchTransitGatewayRoutesResponse -> Maybe [TransitGatewayRoute]
routes :: Prelude.Maybe [TransitGatewayRoute],
    -- | The response's http status code.
    SearchTransitGatewayRoutesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SearchTransitGatewayRoutesResponse
-> SearchTransitGatewayRoutesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchTransitGatewayRoutesResponse
-> SearchTransitGatewayRoutesResponse -> Bool
$c/= :: SearchTransitGatewayRoutesResponse
-> SearchTransitGatewayRoutesResponse -> Bool
== :: SearchTransitGatewayRoutesResponse
-> SearchTransitGatewayRoutesResponse -> Bool
$c== :: SearchTransitGatewayRoutesResponse
-> SearchTransitGatewayRoutesResponse -> Bool
Prelude.Eq, ReadPrec [SearchTransitGatewayRoutesResponse]
ReadPrec SearchTransitGatewayRoutesResponse
Int -> ReadS SearchTransitGatewayRoutesResponse
ReadS [SearchTransitGatewayRoutesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchTransitGatewayRoutesResponse]
$creadListPrec :: ReadPrec [SearchTransitGatewayRoutesResponse]
readPrec :: ReadPrec SearchTransitGatewayRoutesResponse
$creadPrec :: ReadPrec SearchTransitGatewayRoutesResponse
readList :: ReadS [SearchTransitGatewayRoutesResponse]
$creadList :: ReadS [SearchTransitGatewayRoutesResponse]
readsPrec :: Int -> ReadS SearchTransitGatewayRoutesResponse
$creadsPrec :: Int -> ReadS SearchTransitGatewayRoutesResponse
Prelude.Read, Int -> SearchTransitGatewayRoutesResponse -> ShowS
[SearchTransitGatewayRoutesResponse] -> ShowS
SearchTransitGatewayRoutesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchTransitGatewayRoutesResponse] -> ShowS
$cshowList :: [SearchTransitGatewayRoutesResponse] -> ShowS
show :: SearchTransitGatewayRoutesResponse -> String
$cshow :: SearchTransitGatewayRoutesResponse -> String
showsPrec :: Int -> SearchTransitGatewayRoutesResponse -> ShowS
$cshowsPrec :: Int -> SearchTransitGatewayRoutesResponse -> ShowS
Prelude.Show, forall x.
Rep SearchTransitGatewayRoutesResponse x
-> SearchTransitGatewayRoutesResponse
forall x.
SearchTransitGatewayRoutesResponse
-> Rep SearchTransitGatewayRoutesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchTransitGatewayRoutesResponse x
-> SearchTransitGatewayRoutesResponse
$cfrom :: forall x.
SearchTransitGatewayRoutesResponse
-> Rep SearchTransitGatewayRoutesResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchTransitGatewayRoutesResponse' 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:
--
-- 'additionalRoutesAvailable', 'searchTransitGatewayRoutesResponse_additionalRoutesAvailable' - Indicates whether there are additional routes available.
--
-- 'routes', 'searchTransitGatewayRoutesResponse_routes' - Information about the routes.
--
-- 'httpStatus', 'searchTransitGatewayRoutesResponse_httpStatus' - The response's http status code.
newSearchTransitGatewayRoutesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchTransitGatewayRoutesResponse
newSearchTransitGatewayRoutesResponse :: Int -> SearchTransitGatewayRoutesResponse
newSearchTransitGatewayRoutesResponse Int
pHttpStatus_ =
  SearchTransitGatewayRoutesResponse'
    { $sel:additionalRoutesAvailable:SearchTransitGatewayRoutesResponse' :: Maybe Bool
additionalRoutesAvailable =
        forall a. Maybe a
Prelude.Nothing,
      $sel:routes:SearchTransitGatewayRoutesResponse' :: Maybe [TransitGatewayRoute]
routes = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchTransitGatewayRoutesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Indicates whether there are additional routes available.
searchTransitGatewayRoutesResponse_additionalRoutesAvailable :: Lens.Lens' SearchTransitGatewayRoutesResponse (Prelude.Maybe Prelude.Bool)
searchTransitGatewayRoutesResponse_additionalRoutesAvailable :: Lens' SearchTransitGatewayRoutesResponse (Maybe Bool)
searchTransitGatewayRoutesResponse_additionalRoutesAvailable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTransitGatewayRoutesResponse' {Maybe Bool
additionalRoutesAvailable :: Maybe Bool
$sel:additionalRoutesAvailable:SearchTransitGatewayRoutesResponse' :: SearchTransitGatewayRoutesResponse -> Maybe Bool
additionalRoutesAvailable} -> Maybe Bool
additionalRoutesAvailable) (\s :: SearchTransitGatewayRoutesResponse
s@SearchTransitGatewayRoutesResponse' {} Maybe Bool
a -> SearchTransitGatewayRoutesResponse
s {$sel:additionalRoutesAvailable:SearchTransitGatewayRoutesResponse' :: Maybe Bool
additionalRoutesAvailable = Maybe Bool
a} :: SearchTransitGatewayRoutesResponse)

-- | Information about the routes.
searchTransitGatewayRoutesResponse_routes :: Lens.Lens' SearchTransitGatewayRoutesResponse (Prelude.Maybe [TransitGatewayRoute])
searchTransitGatewayRoutesResponse_routes :: Lens'
  SearchTransitGatewayRoutesResponse (Maybe [TransitGatewayRoute])
searchTransitGatewayRoutesResponse_routes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTransitGatewayRoutesResponse' {Maybe [TransitGatewayRoute]
routes :: Maybe [TransitGatewayRoute]
$sel:routes:SearchTransitGatewayRoutesResponse' :: SearchTransitGatewayRoutesResponse -> Maybe [TransitGatewayRoute]
routes} -> Maybe [TransitGatewayRoute]
routes) (\s :: SearchTransitGatewayRoutesResponse
s@SearchTransitGatewayRoutesResponse' {} Maybe [TransitGatewayRoute]
a -> SearchTransitGatewayRoutesResponse
s {$sel:routes:SearchTransitGatewayRoutesResponse' :: Maybe [TransitGatewayRoute]
routes = Maybe [TransitGatewayRoute]
a} :: SearchTransitGatewayRoutesResponse) 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.
searchTransitGatewayRoutesResponse_httpStatus :: Lens.Lens' SearchTransitGatewayRoutesResponse Prelude.Int
searchTransitGatewayRoutesResponse_httpStatus :: Lens' SearchTransitGatewayRoutesResponse Int
searchTransitGatewayRoutesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTransitGatewayRoutesResponse' {Int
httpStatus :: Int
$sel:httpStatus:SearchTransitGatewayRoutesResponse' :: SearchTransitGatewayRoutesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SearchTransitGatewayRoutesResponse
s@SearchTransitGatewayRoutesResponse' {} Int
a -> SearchTransitGatewayRoutesResponse
s {$sel:httpStatus:SearchTransitGatewayRoutesResponse' :: Int
httpStatus = Int
a} :: SearchTransitGatewayRoutesResponse)

instance
  Prelude.NFData
    SearchTransitGatewayRoutesResponse
  where
  rnf :: SearchTransitGatewayRoutesResponse -> ()
rnf SearchTransitGatewayRoutesResponse' {Int
Maybe Bool
Maybe [TransitGatewayRoute]
httpStatus :: Int
routes :: Maybe [TransitGatewayRoute]
additionalRoutesAvailable :: Maybe Bool
$sel:httpStatus:SearchTransitGatewayRoutesResponse' :: SearchTransitGatewayRoutesResponse -> Int
$sel:routes:SearchTransitGatewayRoutesResponse' :: SearchTransitGatewayRoutesResponse -> Maybe [TransitGatewayRoute]
$sel:additionalRoutesAvailable:SearchTransitGatewayRoutesResponse' :: SearchTransitGatewayRoutesResponse -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
additionalRoutesAvailable
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TransitGatewayRoute]
routes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus