{-# 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.NetworkManager.GetNetworkRoutes
-- 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 the network routes of the specified global network.
module Amazonka.NetworkManager.GetNetworkRoutes
  ( -- * Creating a Request
    GetNetworkRoutes (..),
    newGetNetworkRoutes,

    -- * Request Lenses
    getNetworkRoutes_destinationFilters,
    getNetworkRoutes_exactCidrMatches,
    getNetworkRoutes_longestPrefixMatches,
    getNetworkRoutes_prefixListIds,
    getNetworkRoutes_states,
    getNetworkRoutes_subnetOfMatches,
    getNetworkRoutes_supernetOfMatches,
    getNetworkRoutes_types,
    getNetworkRoutes_globalNetworkId,
    getNetworkRoutes_routeTableIdentifier,

    -- * Destructuring the Response
    GetNetworkRoutesResponse (..),
    newGetNetworkRoutesResponse,

    -- * Response Lenses
    getNetworkRoutesResponse_coreNetworkSegmentEdge,
    getNetworkRoutesResponse_networkRoutes,
    getNetworkRoutesResponse_routeTableArn,
    getNetworkRoutesResponse_routeTableTimestamp,
    getNetworkRoutesResponse_routeTableType,
    getNetworkRoutesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.NetworkManager.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetNetworkRoutes' smart constructor.
data GetNetworkRoutes = GetNetworkRoutes'
  { -- | Filter by route table destination. Possible Values:
    -- TRANSIT_GATEWAY_ATTACHMENT_ID, RESOURCE_ID, or RESOURCE_TYPE.
    GetNetworkRoutes -> Maybe (HashMap Text [Text])
destinationFilters :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | An exact CIDR block.
    GetNetworkRoutes -> Maybe [Text]
exactCidrMatches :: Prelude.Maybe [Prelude.Text],
    -- | The most specific route that matches the traffic (longest prefix match).
    GetNetworkRoutes -> Maybe [Text]
longestPrefixMatches :: Prelude.Maybe [Prelude.Text],
    -- | The IDs of the prefix lists.
    GetNetworkRoutes -> Maybe [Text]
prefixListIds :: Prelude.Maybe [Prelude.Text],
    -- | The route states.
    GetNetworkRoutes -> Maybe [RouteState]
states :: Prelude.Maybe [RouteState],
    -- | The routes with a subnet that match the specified CIDR filter.
    GetNetworkRoutes -> Maybe [Text]
subnetOfMatches :: Prelude.Maybe [Prelude.Text],
    -- | The routes with a CIDR that encompasses the CIDR filter. Example: If you
    -- specify 10.0.1.0\/30, then the result returns 10.0.1.0\/29.
    GetNetworkRoutes -> Maybe [Text]
supernetOfMatches :: Prelude.Maybe [Prelude.Text],
    -- | The route types.
    GetNetworkRoutes -> Maybe [RouteType]
types :: Prelude.Maybe [RouteType],
    -- | The ID of the global network.
    GetNetworkRoutes -> Text
globalNetworkId :: Prelude.Text,
    -- | The ID of the route table.
    GetNetworkRoutes -> RouteTableIdentifier
routeTableIdentifier :: RouteTableIdentifier
  }
  deriving (GetNetworkRoutes -> GetNetworkRoutes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetNetworkRoutes -> GetNetworkRoutes -> Bool
$c/= :: GetNetworkRoutes -> GetNetworkRoutes -> Bool
== :: GetNetworkRoutes -> GetNetworkRoutes -> Bool
$c== :: GetNetworkRoutes -> GetNetworkRoutes -> Bool
Prelude.Eq, ReadPrec [GetNetworkRoutes]
ReadPrec GetNetworkRoutes
Int -> ReadS GetNetworkRoutes
ReadS [GetNetworkRoutes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetNetworkRoutes]
$creadListPrec :: ReadPrec [GetNetworkRoutes]
readPrec :: ReadPrec GetNetworkRoutes
$creadPrec :: ReadPrec GetNetworkRoutes
readList :: ReadS [GetNetworkRoutes]
$creadList :: ReadS [GetNetworkRoutes]
readsPrec :: Int -> ReadS GetNetworkRoutes
$creadsPrec :: Int -> ReadS GetNetworkRoutes
Prelude.Read, Int -> GetNetworkRoutes -> ShowS
[GetNetworkRoutes] -> ShowS
GetNetworkRoutes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetNetworkRoutes] -> ShowS
$cshowList :: [GetNetworkRoutes] -> ShowS
show :: GetNetworkRoutes -> String
$cshow :: GetNetworkRoutes -> String
showsPrec :: Int -> GetNetworkRoutes -> ShowS
$cshowsPrec :: Int -> GetNetworkRoutes -> ShowS
Prelude.Show, forall x. Rep GetNetworkRoutes x -> GetNetworkRoutes
forall x. GetNetworkRoutes -> Rep GetNetworkRoutes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetNetworkRoutes x -> GetNetworkRoutes
$cfrom :: forall x. GetNetworkRoutes -> Rep GetNetworkRoutes x
Prelude.Generic)

-- |
-- Create a value of 'GetNetworkRoutes' 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:
--
-- 'destinationFilters', 'getNetworkRoutes_destinationFilters' - Filter by route table destination. Possible Values:
-- TRANSIT_GATEWAY_ATTACHMENT_ID, RESOURCE_ID, or RESOURCE_TYPE.
--
-- 'exactCidrMatches', 'getNetworkRoutes_exactCidrMatches' - An exact CIDR block.
--
-- 'longestPrefixMatches', 'getNetworkRoutes_longestPrefixMatches' - The most specific route that matches the traffic (longest prefix match).
--
-- 'prefixListIds', 'getNetworkRoutes_prefixListIds' - The IDs of the prefix lists.
--
-- 'states', 'getNetworkRoutes_states' - The route states.
--
-- 'subnetOfMatches', 'getNetworkRoutes_subnetOfMatches' - The routes with a subnet that match the specified CIDR filter.
--
-- 'supernetOfMatches', 'getNetworkRoutes_supernetOfMatches' - The routes with a CIDR that encompasses the CIDR filter. Example: If you
-- specify 10.0.1.0\/30, then the result returns 10.0.1.0\/29.
--
-- 'types', 'getNetworkRoutes_types' - The route types.
--
-- 'globalNetworkId', 'getNetworkRoutes_globalNetworkId' - The ID of the global network.
--
-- 'routeTableIdentifier', 'getNetworkRoutes_routeTableIdentifier' - The ID of the route table.
newGetNetworkRoutes ::
  -- | 'globalNetworkId'
  Prelude.Text ->
  -- | 'routeTableIdentifier'
  RouteTableIdentifier ->
  GetNetworkRoutes
newGetNetworkRoutes :: Text -> RouteTableIdentifier -> GetNetworkRoutes
newGetNetworkRoutes
  Text
pGlobalNetworkId_
  RouteTableIdentifier
pRouteTableIdentifier_ =
    GetNetworkRoutes'
      { $sel:destinationFilters:GetNetworkRoutes' :: Maybe (HashMap Text [Text])
destinationFilters =
          forall a. Maybe a
Prelude.Nothing,
        $sel:exactCidrMatches:GetNetworkRoutes' :: Maybe [Text]
exactCidrMatches = forall a. Maybe a
Prelude.Nothing,
        $sel:longestPrefixMatches:GetNetworkRoutes' :: Maybe [Text]
longestPrefixMatches = forall a. Maybe a
Prelude.Nothing,
        $sel:prefixListIds:GetNetworkRoutes' :: Maybe [Text]
prefixListIds = forall a. Maybe a
Prelude.Nothing,
        $sel:states:GetNetworkRoutes' :: Maybe [RouteState]
states = forall a. Maybe a
Prelude.Nothing,
        $sel:subnetOfMatches:GetNetworkRoutes' :: Maybe [Text]
subnetOfMatches = forall a. Maybe a
Prelude.Nothing,
        $sel:supernetOfMatches:GetNetworkRoutes' :: Maybe [Text]
supernetOfMatches = forall a. Maybe a
Prelude.Nothing,
        $sel:types:GetNetworkRoutes' :: Maybe [RouteType]
types = forall a. Maybe a
Prelude.Nothing,
        $sel:globalNetworkId:GetNetworkRoutes' :: Text
globalNetworkId = Text
pGlobalNetworkId_,
        $sel:routeTableIdentifier:GetNetworkRoutes' :: RouteTableIdentifier
routeTableIdentifier = RouteTableIdentifier
pRouteTableIdentifier_
      }

-- | Filter by route table destination. Possible Values:
-- TRANSIT_GATEWAY_ATTACHMENT_ID, RESOURCE_ID, or RESOURCE_TYPE.
getNetworkRoutes_destinationFilters :: Lens.Lens' GetNetworkRoutes (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
getNetworkRoutes_destinationFilters :: Lens' GetNetworkRoutes (Maybe (HashMap Text [Text]))
getNetworkRoutes_destinationFilters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutes' {Maybe (HashMap Text [Text])
destinationFilters :: Maybe (HashMap Text [Text])
$sel:destinationFilters:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe (HashMap Text [Text])
destinationFilters} -> Maybe (HashMap Text [Text])
destinationFilters) (\s :: GetNetworkRoutes
s@GetNetworkRoutes' {} Maybe (HashMap Text [Text])
a -> GetNetworkRoutes
s {$sel:destinationFilters:GetNetworkRoutes' :: Maybe (HashMap Text [Text])
destinationFilters = Maybe (HashMap Text [Text])
a} :: GetNetworkRoutes) 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

-- | An exact CIDR block.
getNetworkRoutes_exactCidrMatches :: Lens.Lens' GetNetworkRoutes (Prelude.Maybe [Prelude.Text])
getNetworkRoutes_exactCidrMatches :: Lens' GetNetworkRoutes (Maybe [Text])
getNetworkRoutes_exactCidrMatches = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutes' {Maybe [Text]
exactCidrMatches :: Maybe [Text]
$sel:exactCidrMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
exactCidrMatches} -> Maybe [Text]
exactCidrMatches) (\s :: GetNetworkRoutes
s@GetNetworkRoutes' {} Maybe [Text]
a -> GetNetworkRoutes
s {$sel:exactCidrMatches:GetNetworkRoutes' :: Maybe [Text]
exactCidrMatches = Maybe [Text]
a} :: GetNetworkRoutes) 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 most specific route that matches the traffic (longest prefix match).
getNetworkRoutes_longestPrefixMatches :: Lens.Lens' GetNetworkRoutes (Prelude.Maybe [Prelude.Text])
getNetworkRoutes_longestPrefixMatches :: Lens' GetNetworkRoutes (Maybe [Text])
getNetworkRoutes_longestPrefixMatches = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutes' {Maybe [Text]
longestPrefixMatches :: Maybe [Text]
$sel:longestPrefixMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
longestPrefixMatches} -> Maybe [Text]
longestPrefixMatches) (\s :: GetNetworkRoutes
s@GetNetworkRoutes' {} Maybe [Text]
a -> GetNetworkRoutes
s {$sel:longestPrefixMatches:GetNetworkRoutes' :: Maybe [Text]
longestPrefixMatches = Maybe [Text]
a} :: GetNetworkRoutes) 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 prefix lists.
getNetworkRoutes_prefixListIds :: Lens.Lens' GetNetworkRoutes (Prelude.Maybe [Prelude.Text])
getNetworkRoutes_prefixListIds :: Lens' GetNetworkRoutes (Maybe [Text])
getNetworkRoutes_prefixListIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutes' {Maybe [Text]
prefixListIds :: Maybe [Text]
$sel:prefixListIds:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
prefixListIds} -> Maybe [Text]
prefixListIds) (\s :: GetNetworkRoutes
s@GetNetworkRoutes' {} Maybe [Text]
a -> GetNetworkRoutes
s {$sel:prefixListIds:GetNetworkRoutes' :: Maybe [Text]
prefixListIds = Maybe [Text]
a} :: GetNetworkRoutes) 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 route states.
getNetworkRoutes_states :: Lens.Lens' GetNetworkRoutes (Prelude.Maybe [RouteState])
getNetworkRoutes_states :: Lens' GetNetworkRoutes (Maybe [RouteState])
getNetworkRoutes_states = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutes' {Maybe [RouteState]
states :: Maybe [RouteState]
$sel:states:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [RouteState]
states} -> Maybe [RouteState]
states) (\s :: GetNetworkRoutes
s@GetNetworkRoutes' {} Maybe [RouteState]
a -> GetNetworkRoutes
s {$sel:states:GetNetworkRoutes' :: Maybe [RouteState]
states = Maybe [RouteState]
a} :: GetNetworkRoutes) 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 routes with a subnet that match the specified CIDR filter.
getNetworkRoutes_subnetOfMatches :: Lens.Lens' GetNetworkRoutes (Prelude.Maybe [Prelude.Text])
getNetworkRoutes_subnetOfMatches :: Lens' GetNetworkRoutes (Maybe [Text])
getNetworkRoutes_subnetOfMatches = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutes' {Maybe [Text]
subnetOfMatches :: Maybe [Text]
$sel:subnetOfMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
subnetOfMatches} -> Maybe [Text]
subnetOfMatches) (\s :: GetNetworkRoutes
s@GetNetworkRoutes' {} Maybe [Text]
a -> GetNetworkRoutes
s {$sel:subnetOfMatches:GetNetworkRoutes' :: Maybe [Text]
subnetOfMatches = Maybe [Text]
a} :: GetNetworkRoutes) 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 routes with a CIDR that encompasses the CIDR filter. Example: If you
-- specify 10.0.1.0\/30, then the result returns 10.0.1.0\/29.
getNetworkRoutes_supernetOfMatches :: Lens.Lens' GetNetworkRoutes (Prelude.Maybe [Prelude.Text])
getNetworkRoutes_supernetOfMatches :: Lens' GetNetworkRoutes (Maybe [Text])
getNetworkRoutes_supernetOfMatches = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutes' {Maybe [Text]
supernetOfMatches :: Maybe [Text]
$sel:supernetOfMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
supernetOfMatches} -> Maybe [Text]
supernetOfMatches) (\s :: GetNetworkRoutes
s@GetNetworkRoutes' {} Maybe [Text]
a -> GetNetworkRoutes
s {$sel:supernetOfMatches:GetNetworkRoutes' :: Maybe [Text]
supernetOfMatches = Maybe [Text]
a} :: GetNetworkRoutes) 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 route types.
getNetworkRoutes_types :: Lens.Lens' GetNetworkRoutes (Prelude.Maybe [RouteType])
getNetworkRoutes_types :: Lens' GetNetworkRoutes (Maybe [RouteType])
getNetworkRoutes_types = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutes' {Maybe [RouteType]
types :: Maybe [RouteType]
$sel:types:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [RouteType]
types} -> Maybe [RouteType]
types) (\s :: GetNetworkRoutes
s@GetNetworkRoutes' {} Maybe [RouteType]
a -> GetNetworkRoutes
s {$sel:types:GetNetworkRoutes' :: Maybe [RouteType]
types = Maybe [RouteType]
a} :: GetNetworkRoutes) 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 ID of the global network.
getNetworkRoutes_globalNetworkId :: Lens.Lens' GetNetworkRoutes Prelude.Text
getNetworkRoutes_globalNetworkId :: Lens' GetNetworkRoutes Text
getNetworkRoutes_globalNetworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutes' {Text
globalNetworkId :: Text
$sel:globalNetworkId:GetNetworkRoutes' :: GetNetworkRoutes -> Text
globalNetworkId} -> Text
globalNetworkId) (\s :: GetNetworkRoutes
s@GetNetworkRoutes' {} Text
a -> GetNetworkRoutes
s {$sel:globalNetworkId:GetNetworkRoutes' :: Text
globalNetworkId = Text
a} :: GetNetworkRoutes)

-- | The ID of the route table.
getNetworkRoutes_routeTableIdentifier :: Lens.Lens' GetNetworkRoutes RouteTableIdentifier
getNetworkRoutes_routeTableIdentifier :: Lens' GetNetworkRoutes RouteTableIdentifier
getNetworkRoutes_routeTableIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutes' {RouteTableIdentifier
routeTableIdentifier :: RouteTableIdentifier
$sel:routeTableIdentifier:GetNetworkRoutes' :: GetNetworkRoutes -> RouteTableIdentifier
routeTableIdentifier} -> RouteTableIdentifier
routeTableIdentifier) (\s :: GetNetworkRoutes
s@GetNetworkRoutes' {} RouteTableIdentifier
a -> GetNetworkRoutes
s {$sel:routeTableIdentifier:GetNetworkRoutes' :: RouteTableIdentifier
routeTableIdentifier = RouteTableIdentifier
a} :: GetNetworkRoutes)

instance Core.AWSRequest GetNetworkRoutes where
  type
    AWSResponse GetNetworkRoutes =
      GetNetworkRoutesResponse
  request :: (Service -> Service)
-> GetNetworkRoutes -> Request GetNetworkRoutes
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetNetworkRoutes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetNetworkRoutes)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe CoreNetworkSegmentEdgeIdentifier
-> Maybe [NetworkRoute]
-> Maybe Text
-> Maybe POSIX
-> Maybe RouteTableType
-> Int
-> GetNetworkRoutesResponse
GetNetworkRoutesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CoreNetworkSegmentEdge")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NetworkRoutes" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RouteTableArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RouteTableTimestamp")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RouteTableType")
            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 GetNetworkRoutes where
  hashWithSalt :: Int -> GetNetworkRoutes -> Int
hashWithSalt Int
_salt GetNetworkRoutes' {Maybe [Text]
Maybe [RouteState]
Maybe [RouteType]
Maybe (HashMap Text [Text])
Text
RouteTableIdentifier
routeTableIdentifier :: RouteTableIdentifier
globalNetworkId :: Text
types :: Maybe [RouteType]
supernetOfMatches :: Maybe [Text]
subnetOfMatches :: Maybe [Text]
states :: Maybe [RouteState]
prefixListIds :: Maybe [Text]
longestPrefixMatches :: Maybe [Text]
exactCidrMatches :: Maybe [Text]
destinationFilters :: Maybe (HashMap Text [Text])
$sel:routeTableIdentifier:GetNetworkRoutes' :: GetNetworkRoutes -> RouteTableIdentifier
$sel:globalNetworkId:GetNetworkRoutes' :: GetNetworkRoutes -> Text
$sel:types:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [RouteType]
$sel:supernetOfMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:subnetOfMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:states:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [RouteState]
$sel:prefixListIds:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:longestPrefixMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:exactCidrMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:destinationFilters:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe (HashMap Text [Text])
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text [Text])
destinationFilters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
exactCidrMatches
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
longestPrefixMatches
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
prefixListIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RouteState]
states
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
subnetOfMatches
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
supernetOfMatches
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RouteType]
types
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
globalNetworkId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RouteTableIdentifier
routeTableIdentifier

instance Prelude.NFData GetNetworkRoutes where
  rnf :: GetNetworkRoutes -> ()
rnf GetNetworkRoutes' {Maybe [Text]
Maybe [RouteState]
Maybe [RouteType]
Maybe (HashMap Text [Text])
Text
RouteTableIdentifier
routeTableIdentifier :: RouteTableIdentifier
globalNetworkId :: Text
types :: Maybe [RouteType]
supernetOfMatches :: Maybe [Text]
subnetOfMatches :: Maybe [Text]
states :: Maybe [RouteState]
prefixListIds :: Maybe [Text]
longestPrefixMatches :: Maybe [Text]
exactCidrMatches :: Maybe [Text]
destinationFilters :: Maybe (HashMap Text [Text])
$sel:routeTableIdentifier:GetNetworkRoutes' :: GetNetworkRoutes -> RouteTableIdentifier
$sel:globalNetworkId:GetNetworkRoutes' :: GetNetworkRoutes -> Text
$sel:types:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [RouteType]
$sel:supernetOfMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:subnetOfMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:states:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [RouteState]
$sel:prefixListIds:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:longestPrefixMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:exactCidrMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:destinationFilters:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe (HashMap Text [Text])
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text [Text])
destinationFilters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
exactCidrMatches
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
longestPrefixMatches
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
prefixListIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RouteState]
states
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
subnetOfMatches
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
supernetOfMatches
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RouteType]
types
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
globalNetworkId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RouteTableIdentifier
routeTableIdentifier

instance Data.ToHeaders GetNetworkRoutes where
  toHeaders :: GetNetworkRoutes -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON GetNetworkRoutes where
  toJSON :: GetNetworkRoutes -> Value
toJSON GetNetworkRoutes' {Maybe [Text]
Maybe [RouteState]
Maybe [RouteType]
Maybe (HashMap Text [Text])
Text
RouteTableIdentifier
routeTableIdentifier :: RouteTableIdentifier
globalNetworkId :: Text
types :: Maybe [RouteType]
supernetOfMatches :: Maybe [Text]
subnetOfMatches :: Maybe [Text]
states :: Maybe [RouteState]
prefixListIds :: Maybe [Text]
longestPrefixMatches :: Maybe [Text]
exactCidrMatches :: Maybe [Text]
destinationFilters :: Maybe (HashMap Text [Text])
$sel:routeTableIdentifier:GetNetworkRoutes' :: GetNetworkRoutes -> RouteTableIdentifier
$sel:globalNetworkId:GetNetworkRoutes' :: GetNetworkRoutes -> Text
$sel:types:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [RouteType]
$sel:supernetOfMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:subnetOfMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:states:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [RouteState]
$sel:prefixListIds:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:longestPrefixMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:exactCidrMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:destinationFilters:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe (HashMap Text [Text])
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DestinationFilters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
destinationFilters,
            (Key
"ExactCidrMatches" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
exactCidrMatches,
            (Key
"LongestPrefixMatches" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
longestPrefixMatches,
            (Key
"PrefixListIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
prefixListIds,
            (Key
"States" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RouteState]
states,
            (Key
"SubnetOfMatches" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
subnetOfMatches,
            (Key
"SupernetOfMatches" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
supernetOfMatches,
            (Key
"Types" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RouteType]
types,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"RouteTableIdentifier"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RouteTableIdentifier
routeTableIdentifier
              )
          ]
      )

instance Data.ToPath GetNetworkRoutes where
  toPath :: GetNetworkRoutes -> ByteString
toPath GetNetworkRoutes' {Maybe [Text]
Maybe [RouteState]
Maybe [RouteType]
Maybe (HashMap Text [Text])
Text
RouteTableIdentifier
routeTableIdentifier :: RouteTableIdentifier
globalNetworkId :: Text
types :: Maybe [RouteType]
supernetOfMatches :: Maybe [Text]
subnetOfMatches :: Maybe [Text]
states :: Maybe [RouteState]
prefixListIds :: Maybe [Text]
longestPrefixMatches :: Maybe [Text]
exactCidrMatches :: Maybe [Text]
destinationFilters :: Maybe (HashMap Text [Text])
$sel:routeTableIdentifier:GetNetworkRoutes' :: GetNetworkRoutes -> RouteTableIdentifier
$sel:globalNetworkId:GetNetworkRoutes' :: GetNetworkRoutes -> Text
$sel:types:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [RouteType]
$sel:supernetOfMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:subnetOfMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:states:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [RouteState]
$sel:prefixListIds:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:longestPrefixMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:exactCidrMatches:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe [Text]
$sel:destinationFilters:GetNetworkRoutes' :: GetNetworkRoutes -> Maybe (HashMap Text [Text])
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/global-networks/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
globalNetworkId,
        ByteString
"/network-routes"
      ]

instance Data.ToQuery GetNetworkRoutes where
  toQuery :: GetNetworkRoutes -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetNetworkRoutesResponse' smart constructor.
data GetNetworkRoutesResponse = GetNetworkRoutesResponse'
  { -- | Describes a core network segment edge.
    GetNetworkRoutesResponse -> Maybe CoreNetworkSegmentEdgeIdentifier
coreNetworkSegmentEdge :: Prelude.Maybe CoreNetworkSegmentEdgeIdentifier,
    -- | The network routes.
    GetNetworkRoutesResponse -> Maybe [NetworkRoute]
networkRoutes :: Prelude.Maybe [NetworkRoute],
    -- | The ARN of the route table.
    GetNetworkRoutesResponse -> Maybe Text
routeTableArn :: Prelude.Maybe Prelude.Text,
    -- | The route table creation time.
    GetNetworkRoutesResponse -> Maybe POSIX
routeTableTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The route table type.
    GetNetworkRoutesResponse -> Maybe RouteTableType
routeTableType :: Prelude.Maybe RouteTableType,
    -- | The response's http status code.
    GetNetworkRoutesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetNetworkRoutesResponse -> GetNetworkRoutesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetNetworkRoutesResponse -> GetNetworkRoutesResponse -> Bool
$c/= :: GetNetworkRoutesResponse -> GetNetworkRoutesResponse -> Bool
== :: GetNetworkRoutesResponse -> GetNetworkRoutesResponse -> Bool
$c== :: GetNetworkRoutesResponse -> GetNetworkRoutesResponse -> Bool
Prelude.Eq, ReadPrec [GetNetworkRoutesResponse]
ReadPrec GetNetworkRoutesResponse
Int -> ReadS GetNetworkRoutesResponse
ReadS [GetNetworkRoutesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetNetworkRoutesResponse]
$creadListPrec :: ReadPrec [GetNetworkRoutesResponse]
readPrec :: ReadPrec GetNetworkRoutesResponse
$creadPrec :: ReadPrec GetNetworkRoutesResponse
readList :: ReadS [GetNetworkRoutesResponse]
$creadList :: ReadS [GetNetworkRoutesResponse]
readsPrec :: Int -> ReadS GetNetworkRoutesResponse
$creadsPrec :: Int -> ReadS GetNetworkRoutesResponse
Prelude.Read, Int -> GetNetworkRoutesResponse -> ShowS
[GetNetworkRoutesResponse] -> ShowS
GetNetworkRoutesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetNetworkRoutesResponse] -> ShowS
$cshowList :: [GetNetworkRoutesResponse] -> ShowS
show :: GetNetworkRoutesResponse -> String
$cshow :: GetNetworkRoutesResponse -> String
showsPrec :: Int -> GetNetworkRoutesResponse -> ShowS
$cshowsPrec :: Int -> GetNetworkRoutesResponse -> ShowS
Prelude.Show, forall x.
Rep GetNetworkRoutesResponse x -> GetNetworkRoutesResponse
forall x.
GetNetworkRoutesResponse -> Rep GetNetworkRoutesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetNetworkRoutesResponse x -> GetNetworkRoutesResponse
$cfrom :: forall x.
GetNetworkRoutesResponse -> Rep GetNetworkRoutesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetNetworkRoutesResponse' 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:
--
-- 'coreNetworkSegmentEdge', 'getNetworkRoutesResponse_coreNetworkSegmentEdge' - Describes a core network segment edge.
--
-- 'networkRoutes', 'getNetworkRoutesResponse_networkRoutes' - The network routes.
--
-- 'routeTableArn', 'getNetworkRoutesResponse_routeTableArn' - The ARN of the route table.
--
-- 'routeTableTimestamp', 'getNetworkRoutesResponse_routeTableTimestamp' - The route table creation time.
--
-- 'routeTableType', 'getNetworkRoutesResponse_routeTableType' - The route table type.
--
-- 'httpStatus', 'getNetworkRoutesResponse_httpStatus' - The response's http status code.
newGetNetworkRoutesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetNetworkRoutesResponse
newGetNetworkRoutesResponse :: Int -> GetNetworkRoutesResponse
newGetNetworkRoutesResponse Int
pHttpStatus_ =
  GetNetworkRoutesResponse'
    { $sel:coreNetworkSegmentEdge:GetNetworkRoutesResponse' :: Maybe CoreNetworkSegmentEdgeIdentifier
coreNetworkSegmentEdge =
        forall a. Maybe a
Prelude.Nothing,
      $sel:networkRoutes:GetNetworkRoutesResponse' :: Maybe [NetworkRoute]
networkRoutes = forall a. Maybe a
Prelude.Nothing,
      $sel:routeTableArn:GetNetworkRoutesResponse' :: Maybe Text
routeTableArn = forall a. Maybe a
Prelude.Nothing,
      $sel:routeTableTimestamp:GetNetworkRoutesResponse' :: Maybe POSIX
routeTableTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:routeTableType:GetNetworkRoutesResponse' :: Maybe RouteTableType
routeTableType = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetNetworkRoutesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Describes a core network segment edge.
getNetworkRoutesResponse_coreNetworkSegmentEdge :: Lens.Lens' GetNetworkRoutesResponse (Prelude.Maybe CoreNetworkSegmentEdgeIdentifier)
getNetworkRoutesResponse_coreNetworkSegmentEdge :: Lens'
  GetNetworkRoutesResponse (Maybe CoreNetworkSegmentEdgeIdentifier)
getNetworkRoutesResponse_coreNetworkSegmentEdge = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutesResponse' {Maybe CoreNetworkSegmentEdgeIdentifier
coreNetworkSegmentEdge :: Maybe CoreNetworkSegmentEdgeIdentifier
$sel:coreNetworkSegmentEdge:GetNetworkRoutesResponse' :: GetNetworkRoutesResponse -> Maybe CoreNetworkSegmentEdgeIdentifier
coreNetworkSegmentEdge} -> Maybe CoreNetworkSegmentEdgeIdentifier
coreNetworkSegmentEdge) (\s :: GetNetworkRoutesResponse
s@GetNetworkRoutesResponse' {} Maybe CoreNetworkSegmentEdgeIdentifier
a -> GetNetworkRoutesResponse
s {$sel:coreNetworkSegmentEdge:GetNetworkRoutesResponse' :: Maybe CoreNetworkSegmentEdgeIdentifier
coreNetworkSegmentEdge = Maybe CoreNetworkSegmentEdgeIdentifier
a} :: GetNetworkRoutesResponse)

-- | The network routes.
getNetworkRoutesResponse_networkRoutes :: Lens.Lens' GetNetworkRoutesResponse (Prelude.Maybe [NetworkRoute])
getNetworkRoutesResponse_networkRoutes :: Lens' GetNetworkRoutesResponse (Maybe [NetworkRoute])
getNetworkRoutesResponse_networkRoutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutesResponse' {Maybe [NetworkRoute]
networkRoutes :: Maybe [NetworkRoute]
$sel:networkRoutes:GetNetworkRoutesResponse' :: GetNetworkRoutesResponse -> Maybe [NetworkRoute]
networkRoutes} -> Maybe [NetworkRoute]
networkRoutes) (\s :: GetNetworkRoutesResponse
s@GetNetworkRoutesResponse' {} Maybe [NetworkRoute]
a -> GetNetworkRoutesResponse
s {$sel:networkRoutes:GetNetworkRoutesResponse' :: Maybe [NetworkRoute]
networkRoutes = Maybe [NetworkRoute]
a} :: GetNetworkRoutesResponse) 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 ARN of the route table.
getNetworkRoutesResponse_routeTableArn :: Lens.Lens' GetNetworkRoutesResponse (Prelude.Maybe Prelude.Text)
getNetworkRoutesResponse_routeTableArn :: Lens' GetNetworkRoutesResponse (Maybe Text)
getNetworkRoutesResponse_routeTableArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutesResponse' {Maybe Text
routeTableArn :: Maybe Text
$sel:routeTableArn:GetNetworkRoutesResponse' :: GetNetworkRoutesResponse -> Maybe Text
routeTableArn} -> Maybe Text
routeTableArn) (\s :: GetNetworkRoutesResponse
s@GetNetworkRoutesResponse' {} Maybe Text
a -> GetNetworkRoutesResponse
s {$sel:routeTableArn:GetNetworkRoutesResponse' :: Maybe Text
routeTableArn = Maybe Text
a} :: GetNetworkRoutesResponse)

-- | The route table creation time.
getNetworkRoutesResponse_routeTableTimestamp :: Lens.Lens' GetNetworkRoutesResponse (Prelude.Maybe Prelude.UTCTime)
getNetworkRoutesResponse_routeTableTimestamp :: Lens' GetNetworkRoutesResponse (Maybe UTCTime)
getNetworkRoutesResponse_routeTableTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutesResponse' {Maybe POSIX
routeTableTimestamp :: Maybe POSIX
$sel:routeTableTimestamp:GetNetworkRoutesResponse' :: GetNetworkRoutesResponse -> Maybe POSIX
routeTableTimestamp} -> Maybe POSIX
routeTableTimestamp) (\s :: GetNetworkRoutesResponse
s@GetNetworkRoutesResponse' {} Maybe POSIX
a -> GetNetworkRoutesResponse
s {$sel:routeTableTimestamp:GetNetworkRoutesResponse' :: Maybe POSIX
routeTableTimestamp = Maybe POSIX
a} :: GetNetworkRoutesResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The route table type.
getNetworkRoutesResponse_routeTableType :: Lens.Lens' GetNetworkRoutesResponse (Prelude.Maybe RouteTableType)
getNetworkRoutesResponse_routeTableType :: Lens' GetNetworkRoutesResponse (Maybe RouteTableType)
getNetworkRoutesResponse_routeTableType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetNetworkRoutesResponse' {Maybe RouteTableType
routeTableType :: Maybe RouteTableType
$sel:routeTableType:GetNetworkRoutesResponse' :: GetNetworkRoutesResponse -> Maybe RouteTableType
routeTableType} -> Maybe RouteTableType
routeTableType) (\s :: GetNetworkRoutesResponse
s@GetNetworkRoutesResponse' {} Maybe RouteTableType
a -> GetNetworkRoutesResponse
s {$sel:routeTableType:GetNetworkRoutesResponse' :: Maybe RouteTableType
routeTableType = Maybe RouteTableType
a} :: GetNetworkRoutesResponse)

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

instance Prelude.NFData GetNetworkRoutesResponse where
  rnf :: GetNetworkRoutesResponse -> ()
rnf GetNetworkRoutesResponse' {Int
Maybe [NetworkRoute]
Maybe Text
Maybe POSIX
Maybe CoreNetworkSegmentEdgeIdentifier
Maybe RouteTableType
httpStatus :: Int
routeTableType :: Maybe RouteTableType
routeTableTimestamp :: Maybe POSIX
routeTableArn :: Maybe Text
networkRoutes :: Maybe [NetworkRoute]
coreNetworkSegmentEdge :: Maybe CoreNetworkSegmentEdgeIdentifier
$sel:httpStatus:GetNetworkRoutesResponse' :: GetNetworkRoutesResponse -> Int
$sel:routeTableType:GetNetworkRoutesResponse' :: GetNetworkRoutesResponse -> Maybe RouteTableType
$sel:routeTableTimestamp:GetNetworkRoutesResponse' :: GetNetworkRoutesResponse -> Maybe POSIX
$sel:routeTableArn:GetNetworkRoutesResponse' :: GetNetworkRoutesResponse -> Maybe Text
$sel:networkRoutes:GetNetworkRoutesResponse' :: GetNetworkRoutesResponse -> Maybe [NetworkRoute]
$sel:coreNetworkSegmentEdge:GetNetworkRoutesResponse' :: GetNetworkRoutesResponse -> Maybe CoreNetworkSegmentEdgeIdentifier
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe CoreNetworkSegmentEdgeIdentifier
coreNetworkSegmentEdge
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [NetworkRoute]
networkRoutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
routeTableArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
routeTableTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RouteTableType
routeTableType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus