{-# 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.AppMesh.ListGatewayRoutes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of existing gateway routes that are associated to a
-- virtual gateway.
--
-- This operation returns paginated results.
module Amazonka.AppMesh.ListGatewayRoutes
  ( -- * Creating a Request
    ListGatewayRoutes (..),
    newListGatewayRoutes,

    -- * Request Lenses
    listGatewayRoutes_limit,
    listGatewayRoutes_meshOwner,
    listGatewayRoutes_nextToken,
    listGatewayRoutes_meshName,
    listGatewayRoutes_virtualGatewayName,

    -- * Destructuring the Response
    ListGatewayRoutesResponse (..),
    newListGatewayRoutesResponse,

    -- * Response Lenses
    listGatewayRoutesResponse_nextToken,
    listGatewayRoutesResponse_httpStatus,
    listGatewayRoutesResponse_gatewayRoutes,
  )
where

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

-- | /See:/ 'newListGatewayRoutes' smart constructor.
data ListGatewayRoutes = ListGatewayRoutes'
  { -- | The maximum number of results returned by @ListGatewayRoutes@ in
    -- paginated output. When you use this parameter, @ListGatewayRoutes@
    -- returns only @limit@ results in a single page along with a @nextToken@
    -- response element. You can see the remaining results of the initial
    -- request by sending another @ListGatewayRoutes@ request with the returned
    -- @nextToken@ value. This value can be between 1 and 100. If you don\'t
    -- use this parameter, @ListGatewayRoutes@ returns up to 100 results and a
    -- @nextToken@ value if applicable.
    ListGatewayRoutes -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Web Services IAM account ID of the service mesh owner. If the
    -- account ID is not your own, then it\'s the ID of the account that shared
    -- the mesh with your account. For more information about mesh sharing, see
    -- <https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html Working with shared meshes>.
    ListGatewayRoutes -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
    -- | The @nextToken@ value returned from a previous paginated
    -- @ListGatewayRoutes@ request where @limit@ was used and the results
    -- exceeded the value of that parameter. Pagination continues from the end
    -- of the previous results that returned the @nextToken@ value.
    ListGatewayRoutes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the service mesh to list gateway routes in.
    ListGatewayRoutes -> Text
meshName :: Prelude.Text,
    -- | The name of the virtual gateway to list gateway routes in.
    ListGatewayRoutes -> Text
virtualGatewayName :: Prelude.Text
  }
  deriving (ListGatewayRoutes -> ListGatewayRoutes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGatewayRoutes -> ListGatewayRoutes -> Bool
$c/= :: ListGatewayRoutes -> ListGatewayRoutes -> Bool
== :: ListGatewayRoutes -> ListGatewayRoutes -> Bool
$c== :: ListGatewayRoutes -> ListGatewayRoutes -> Bool
Prelude.Eq, ReadPrec [ListGatewayRoutes]
ReadPrec ListGatewayRoutes
Int -> ReadS ListGatewayRoutes
ReadS [ListGatewayRoutes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGatewayRoutes]
$creadListPrec :: ReadPrec [ListGatewayRoutes]
readPrec :: ReadPrec ListGatewayRoutes
$creadPrec :: ReadPrec ListGatewayRoutes
readList :: ReadS [ListGatewayRoutes]
$creadList :: ReadS [ListGatewayRoutes]
readsPrec :: Int -> ReadS ListGatewayRoutes
$creadsPrec :: Int -> ReadS ListGatewayRoutes
Prelude.Read, Int -> ListGatewayRoutes -> ShowS
[ListGatewayRoutes] -> ShowS
ListGatewayRoutes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGatewayRoutes] -> ShowS
$cshowList :: [ListGatewayRoutes] -> ShowS
show :: ListGatewayRoutes -> String
$cshow :: ListGatewayRoutes -> String
showsPrec :: Int -> ListGatewayRoutes -> ShowS
$cshowsPrec :: Int -> ListGatewayRoutes -> ShowS
Prelude.Show, forall x. Rep ListGatewayRoutes x -> ListGatewayRoutes
forall x. ListGatewayRoutes -> Rep ListGatewayRoutes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGatewayRoutes x -> ListGatewayRoutes
$cfrom :: forall x. ListGatewayRoutes -> Rep ListGatewayRoutes x
Prelude.Generic)

-- |
-- Create a value of 'ListGatewayRoutes' 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:
--
-- 'limit', 'listGatewayRoutes_limit' - The maximum number of results returned by @ListGatewayRoutes@ in
-- paginated output. When you use this parameter, @ListGatewayRoutes@
-- returns only @limit@ results in a single page along with a @nextToken@
-- response element. You can see the remaining results of the initial
-- request by sending another @ListGatewayRoutes@ request with the returned
-- @nextToken@ value. This value can be between 1 and 100. If you don\'t
-- use this parameter, @ListGatewayRoutes@ returns up to 100 results and a
-- @nextToken@ value if applicable.
--
-- 'meshOwner', 'listGatewayRoutes_meshOwner' - The Amazon Web Services IAM account ID of the service mesh owner. If the
-- account ID is not your own, then it\'s the ID of the account that shared
-- the mesh with your account. For more information about mesh sharing, see
-- <https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html Working with shared meshes>.
--
-- 'nextToken', 'listGatewayRoutes_nextToken' - The @nextToken@ value returned from a previous paginated
-- @ListGatewayRoutes@ request where @limit@ was used and the results
-- exceeded the value of that parameter. Pagination continues from the end
-- of the previous results that returned the @nextToken@ value.
--
-- 'meshName', 'listGatewayRoutes_meshName' - The name of the service mesh to list gateway routes in.
--
-- 'virtualGatewayName', 'listGatewayRoutes_virtualGatewayName' - The name of the virtual gateway to list gateway routes in.
newListGatewayRoutes ::
  -- | 'meshName'
  Prelude.Text ->
  -- | 'virtualGatewayName'
  Prelude.Text ->
  ListGatewayRoutes
newListGatewayRoutes :: Text -> Text -> ListGatewayRoutes
newListGatewayRoutes Text
pMeshName_ Text
pVirtualGatewayName_ =
  ListGatewayRoutes'
    { $sel:limit:ListGatewayRoutes' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
      $sel:meshOwner:ListGatewayRoutes' :: Maybe Text
meshOwner = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListGatewayRoutes' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:meshName:ListGatewayRoutes' :: Text
meshName = Text
pMeshName_,
      $sel:virtualGatewayName:ListGatewayRoutes' :: Text
virtualGatewayName = Text
pVirtualGatewayName_
    }

-- | The maximum number of results returned by @ListGatewayRoutes@ in
-- paginated output. When you use this parameter, @ListGatewayRoutes@
-- returns only @limit@ results in a single page along with a @nextToken@
-- response element. You can see the remaining results of the initial
-- request by sending another @ListGatewayRoutes@ request with the returned
-- @nextToken@ value. This value can be between 1 and 100. If you don\'t
-- use this parameter, @ListGatewayRoutes@ returns up to 100 results and a
-- @nextToken@ value if applicable.
listGatewayRoutes_limit :: Lens.Lens' ListGatewayRoutes (Prelude.Maybe Prelude.Natural)
listGatewayRoutes_limit :: Lens' ListGatewayRoutes (Maybe Natural)
listGatewayRoutes_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayRoutes' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListGatewayRoutes
s@ListGatewayRoutes' {} Maybe Natural
a -> ListGatewayRoutes
s {$sel:limit:ListGatewayRoutes' :: Maybe Natural
limit = Maybe Natural
a} :: ListGatewayRoutes)

-- | The Amazon Web Services IAM account ID of the service mesh owner. If the
-- account ID is not your own, then it\'s the ID of the account that shared
-- the mesh with your account. For more information about mesh sharing, see
-- <https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html Working with shared meshes>.
listGatewayRoutes_meshOwner :: Lens.Lens' ListGatewayRoutes (Prelude.Maybe Prelude.Text)
listGatewayRoutes_meshOwner :: Lens' ListGatewayRoutes (Maybe Text)
listGatewayRoutes_meshOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayRoutes' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: ListGatewayRoutes
s@ListGatewayRoutes' {} Maybe Text
a -> ListGatewayRoutes
s {$sel:meshOwner:ListGatewayRoutes' :: Maybe Text
meshOwner = Maybe Text
a} :: ListGatewayRoutes)

-- | The @nextToken@ value returned from a previous paginated
-- @ListGatewayRoutes@ request where @limit@ was used and the results
-- exceeded the value of that parameter. Pagination continues from the end
-- of the previous results that returned the @nextToken@ value.
listGatewayRoutes_nextToken :: Lens.Lens' ListGatewayRoutes (Prelude.Maybe Prelude.Text)
listGatewayRoutes_nextToken :: Lens' ListGatewayRoutes (Maybe Text)
listGatewayRoutes_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayRoutes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGatewayRoutes
s@ListGatewayRoutes' {} Maybe Text
a -> ListGatewayRoutes
s {$sel:nextToken:ListGatewayRoutes' :: Maybe Text
nextToken = Maybe Text
a} :: ListGatewayRoutes)

-- | The name of the service mesh to list gateway routes in.
listGatewayRoutes_meshName :: Lens.Lens' ListGatewayRoutes Prelude.Text
listGatewayRoutes_meshName :: Lens' ListGatewayRoutes Text
listGatewayRoutes_meshName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayRoutes' {Text
meshName :: Text
$sel:meshName:ListGatewayRoutes' :: ListGatewayRoutes -> Text
meshName} -> Text
meshName) (\s :: ListGatewayRoutes
s@ListGatewayRoutes' {} Text
a -> ListGatewayRoutes
s {$sel:meshName:ListGatewayRoutes' :: Text
meshName = Text
a} :: ListGatewayRoutes)

-- | The name of the virtual gateway to list gateway routes in.
listGatewayRoutes_virtualGatewayName :: Lens.Lens' ListGatewayRoutes Prelude.Text
listGatewayRoutes_virtualGatewayName :: Lens' ListGatewayRoutes Text
listGatewayRoutes_virtualGatewayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayRoutes' {Text
virtualGatewayName :: Text
$sel:virtualGatewayName:ListGatewayRoutes' :: ListGatewayRoutes -> Text
virtualGatewayName} -> Text
virtualGatewayName) (\s :: ListGatewayRoutes
s@ListGatewayRoutes' {} Text
a -> ListGatewayRoutes
s {$sel:virtualGatewayName:ListGatewayRoutes' :: Text
virtualGatewayName = Text
a} :: ListGatewayRoutes)

instance Core.AWSPager ListGatewayRoutes where
  page :: ListGatewayRoutes
-> AWSResponse ListGatewayRoutes -> Maybe ListGatewayRoutes
page ListGatewayRoutes
rq AWSResponse ListGatewayRoutes
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListGatewayRoutes
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListGatewayRoutesResponse (Maybe Text)
listGatewayRoutesResponse_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 ListGatewayRoutes
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListGatewayRoutesResponse [GatewayRouteRef]
listGatewayRoutesResponse_gatewayRoutes) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListGatewayRoutes
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListGatewayRoutes (Maybe Text)
listGatewayRoutes_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListGatewayRoutes
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListGatewayRoutesResponse (Maybe Text)
listGatewayRoutesResponse_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 ListGatewayRoutes where
  type
    AWSResponse ListGatewayRoutes =
      ListGatewayRoutesResponse
  request :: (Service -> Service)
-> ListGatewayRoutes -> Request ListGatewayRoutes
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListGatewayRoutes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListGatewayRoutes)))
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 Text -> Int -> [GatewayRouteRef] -> ListGatewayRoutesResponse
ListGatewayRoutesResponse'
            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
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            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
"gatewayRoutes" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListGatewayRoutes where
  hashWithSalt :: Int -> ListGatewayRoutes -> Int
hashWithSalt Int
_salt ListGatewayRoutes' {Maybe Natural
Maybe Text
Text
virtualGatewayName :: Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:virtualGatewayName:ListGatewayRoutes' :: ListGatewayRoutes -> Text
$sel:meshName:ListGatewayRoutes' :: ListGatewayRoutes -> Text
$sel:nextToken:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Text
$sel:meshOwner:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Text
$sel:limit:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
meshOwner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
meshName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
virtualGatewayName

instance Prelude.NFData ListGatewayRoutes where
  rnf :: ListGatewayRoutes -> ()
rnf ListGatewayRoutes' {Maybe Natural
Maybe Text
Text
virtualGatewayName :: Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:virtualGatewayName:ListGatewayRoutes' :: ListGatewayRoutes -> Text
$sel:meshName:ListGatewayRoutes' :: ListGatewayRoutes -> Text
$sel:nextToken:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Text
$sel:meshOwner:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Text
$sel:limit:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
meshOwner
      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
meshName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
virtualGatewayName

instance Data.ToHeaders ListGatewayRoutes where
  toHeaders :: ListGatewayRoutes -> 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.ToPath ListGatewayRoutes where
  toPath :: ListGatewayRoutes -> ByteString
toPath ListGatewayRoutes' {Maybe Natural
Maybe Text
Text
virtualGatewayName :: Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:virtualGatewayName:ListGatewayRoutes' :: ListGatewayRoutes -> Text
$sel:meshName:ListGatewayRoutes' :: ListGatewayRoutes -> Text
$sel:nextToken:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Text
$sel:meshOwner:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Text
$sel:limit:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v20190125/meshes/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
meshName,
        ByteString
"/virtualGateway/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
virtualGatewayName,
        ByteString
"/gatewayRoutes"
      ]

instance Data.ToQuery ListGatewayRoutes where
  toQuery :: ListGatewayRoutes -> QueryString
toQuery ListGatewayRoutes' {Maybe Natural
Maybe Text
Text
virtualGatewayName :: Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:virtualGatewayName:ListGatewayRoutes' :: ListGatewayRoutes -> Text
$sel:meshName:ListGatewayRoutes' :: ListGatewayRoutes -> Text
$sel:nextToken:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Text
$sel:meshOwner:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Text
$sel:limit:ListGatewayRoutes' :: ListGatewayRoutes -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"limit" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
limit,
        ByteString
"meshOwner" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
meshOwner,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newListGatewayRoutesResponse' smart constructor.
data ListGatewayRoutesResponse = ListGatewayRoutesResponse'
  { -- | The @nextToken@ value to include in a future @ListGatewayRoutes@
    -- request. When the results of a @ListGatewayRoutes@ request exceed
    -- @limit@, you can use this value to retrieve the next page of results.
    -- This value is @null@ when there are no more results to return.
    ListGatewayRoutesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListGatewayRoutesResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of existing gateway routes for the specified service mesh and
    -- virtual gateway.
    ListGatewayRoutesResponse -> [GatewayRouteRef]
gatewayRoutes :: [GatewayRouteRef]
  }
  deriving (ListGatewayRoutesResponse -> ListGatewayRoutesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGatewayRoutesResponse -> ListGatewayRoutesResponse -> Bool
$c/= :: ListGatewayRoutesResponse -> ListGatewayRoutesResponse -> Bool
== :: ListGatewayRoutesResponse -> ListGatewayRoutesResponse -> Bool
$c== :: ListGatewayRoutesResponse -> ListGatewayRoutesResponse -> Bool
Prelude.Eq, ReadPrec [ListGatewayRoutesResponse]
ReadPrec ListGatewayRoutesResponse
Int -> ReadS ListGatewayRoutesResponse
ReadS [ListGatewayRoutesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGatewayRoutesResponse]
$creadListPrec :: ReadPrec [ListGatewayRoutesResponse]
readPrec :: ReadPrec ListGatewayRoutesResponse
$creadPrec :: ReadPrec ListGatewayRoutesResponse
readList :: ReadS [ListGatewayRoutesResponse]
$creadList :: ReadS [ListGatewayRoutesResponse]
readsPrec :: Int -> ReadS ListGatewayRoutesResponse
$creadsPrec :: Int -> ReadS ListGatewayRoutesResponse
Prelude.Read, Int -> ListGatewayRoutesResponse -> ShowS
[ListGatewayRoutesResponse] -> ShowS
ListGatewayRoutesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGatewayRoutesResponse] -> ShowS
$cshowList :: [ListGatewayRoutesResponse] -> ShowS
show :: ListGatewayRoutesResponse -> String
$cshow :: ListGatewayRoutesResponse -> String
showsPrec :: Int -> ListGatewayRoutesResponse -> ShowS
$cshowsPrec :: Int -> ListGatewayRoutesResponse -> ShowS
Prelude.Show, forall x.
Rep ListGatewayRoutesResponse x -> ListGatewayRoutesResponse
forall x.
ListGatewayRoutesResponse -> Rep ListGatewayRoutesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGatewayRoutesResponse x -> ListGatewayRoutesResponse
$cfrom :: forall x.
ListGatewayRoutesResponse -> Rep ListGatewayRoutesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListGatewayRoutesResponse' 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', 'listGatewayRoutesResponse_nextToken' - The @nextToken@ value to include in a future @ListGatewayRoutes@
-- request. When the results of a @ListGatewayRoutes@ request exceed
-- @limit@, you can use this value to retrieve the next page of results.
-- This value is @null@ when there are no more results to return.
--
-- 'httpStatus', 'listGatewayRoutesResponse_httpStatus' - The response's http status code.
--
-- 'gatewayRoutes', 'listGatewayRoutesResponse_gatewayRoutes' - The list of existing gateway routes for the specified service mesh and
-- virtual gateway.
newListGatewayRoutesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListGatewayRoutesResponse
newListGatewayRoutesResponse :: Int -> ListGatewayRoutesResponse
newListGatewayRoutesResponse Int
pHttpStatus_ =
  ListGatewayRoutesResponse'
    { $sel:nextToken:ListGatewayRoutesResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListGatewayRoutesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:gatewayRoutes:ListGatewayRoutesResponse' :: [GatewayRouteRef]
gatewayRoutes = forall a. Monoid a => a
Prelude.mempty
    }

-- | The @nextToken@ value to include in a future @ListGatewayRoutes@
-- request. When the results of a @ListGatewayRoutes@ request exceed
-- @limit@, you can use this value to retrieve the next page of results.
-- This value is @null@ when there are no more results to return.
listGatewayRoutesResponse_nextToken :: Lens.Lens' ListGatewayRoutesResponse (Prelude.Maybe Prelude.Text)
listGatewayRoutesResponse_nextToken :: Lens' ListGatewayRoutesResponse (Maybe Text)
listGatewayRoutesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayRoutesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGatewayRoutesResponse' :: ListGatewayRoutesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGatewayRoutesResponse
s@ListGatewayRoutesResponse' {} Maybe Text
a -> ListGatewayRoutesResponse
s {$sel:nextToken:ListGatewayRoutesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListGatewayRoutesResponse)

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

-- | The list of existing gateway routes for the specified service mesh and
-- virtual gateway.
listGatewayRoutesResponse_gatewayRoutes :: Lens.Lens' ListGatewayRoutesResponse [GatewayRouteRef]
listGatewayRoutesResponse_gatewayRoutes :: Lens' ListGatewayRoutesResponse [GatewayRouteRef]
listGatewayRoutesResponse_gatewayRoutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayRoutesResponse' {[GatewayRouteRef]
gatewayRoutes :: [GatewayRouteRef]
$sel:gatewayRoutes:ListGatewayRoutesResponse' :: ListGatewayRoutesResponse -> [GatewayRouteRef]
gatewayRoutes} -> [GatewayRouteRef]
gatewayRoutes) (\s :: ListGatewayRoutesResponse
s@ListGatewayRoutesResponse' {} [GatewayRouteRef]
a -> ListGatewayRoutesResponse
s {$sel:gatewayRoutes:ListGatewayRoutesResponse' :: [GatewayRouteRef]
gatewayRoutes = [GatewayRouteRef]
a} :: ListGatewayRoutesResponse) 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 Prelude.NFData ListGatewayRoutesResponse where
  rnf :: ListGatewayRoutesResponse -> ()
rnf ListGatewayRoutesResponse' {Int
[GatewayRouteRef]
Maybe Text
gatewayRoutes :: [GatewayRouteRef]
httpStatus :: Int
nextToken :: Maybe Text
$sel:gatewayRoutes:ListGatewayRoutesResponse' :: ListGatewayRoutesResponse -> [GatewayRouteRef]
$sel:httpStatus:ListGatewayRoutesResponse' :: ListGatewayRoutesResponse -> Int
$sel:nextToken:ListGatewayRoutesResponse' :: ListGatewayRoutesResponse -> 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 Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [GatewayRouteRef]
gatewayRoutes