{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- 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_meshOwner,
    listGatewayRoutes_nextToken,
    listGatewayRoutes_limit,
    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.Lens as Lens
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 AWS 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 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 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
(ListGatewayRoutes -> ListGatewayRoutes -> Bool)
-> (ListGatewayRoutes -> ListGatewayRoutes -> Bool)
-> Eq ListGatewayRoutes
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]
(Int -> ReadS ListGatewayRoutes)
-> ReadS [ListGatewayRoutes]
-> ReadPrec ListGatewayRoutes
-> ReadPrec [ListGatewayRoutes]
-> Read 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
(Int -> ListGatewayRoutes -> ShowS)
-> (ListGatewayRoutes -> String)
-> ([ListGatewayRoutes] -> ShowS)
-> Show ListGatewayRoutes
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. ListGatewayRoutes -> Rep ListGatewayRoutes x)
-> (forall x. Rep ListGatewayRoutes x -> ListGatewayRoutes)
-> Generic ListGatewayRoutes
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:
--
-- 'meshOwner', 'listGatewayRoutes_meshOwner' - The AWS 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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Text -> Maybe Natural -> Text -> Text -> ListGatewayRoutes
ListGatewayRoutes'
    { $sel:meshOwner:ListGatewayRoutes' :: Maybe Text
meshOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListGatewayRoutes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListGatewayRoutes' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:meshName:ListGatewayRoutes' :: Text
meshName = Text
pMeshName_,
      $sel:virtualGatewayName:ListGatewayRoutes' :: Text
virtualGatewayName = Text
pVirtualGatewayName_
    }

-- | The AWS 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 :: (Maybe Text -> f (Maybe Text))
-> ListGatewayRoutes -> f ListGatewayRoutes
listGatewayRoutes_meshOwner = (ListGatewayRoutes -> Maybe Text)
-> (ListGatewayRoutes -> Maybe Text -> ListGatewayRoutes)
-> Lens
     ListGatewayRoutes ListGatewayRoutes (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> ListGatewayRoutes -> f ListGatewayRoutes
listGatewayRoutes_nextToken = (ListGatewayRoutes -> Maybe Text)
-> (ListGatewayRoutes -> Maybe Text -> ListGatewayRoutes)
-> Lens
     ListGatewayRoutes ListGatewayRoutes (Maybe Text) (Maybe Text)
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 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 :: (Maybe Natural -> f (Maybe Natural))
-> ListGatewayRoutes -> f ListGatewayRoutes
listGatewayRoutes_limit = (ListGatewayRoutes -> Maybe Natural)
-> (ListGatewayRoutes -> Maybe Natural -> ListGatewayRoutes)
-> Lens
     ListGatewayRoutes ListGatewayRoutes (Maybe Natural) (Maybe Natural)
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 name of the service mesh to list gateway routes in.
listGatewayRoutes_meshName :: Lens.Lens' ListGatewayRoutes Prelude.Text
listGatewayRoutes_meshName :: (Text -> f Text) -> ListGatewayRoutes -> f ListGatewayRoutes
listGatewayRoutes_meshName = (ListGatewayRoutes -> Text)
-> (ListGatewayRoutes -> Text -> ListGatewayRoutes)
-> Lens ListGatewayRoutes ListGatewayRoutes Text Text
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 :: (Text -> f Text) -> ListGatewayRoutes -> f ListGatewayRoutes
listGatewayRoutes_virtualGatewayName = (ListGatewayRoutes -> Text)
-> (ListGatewayRoutes -> Text -> ListGatewayRoutes)
-> Lens ListGatewayRoutes ListGatewayRoutes Text Text
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListGatewayRoutes
ListGatewayRoutesResponse
rs
            ListGatewayRoutesResponse
-> Getting (First Text) ListGatewayRoutesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListGatewayRoutesResponse
-> Const (First Text) ListGatewayRoutesResponse
Lens' ListGatewayRoutesResponse (Maybe Text)
listGatewayRoutesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListGatewayRoutesResponse
 -> Const (First Text) ListGatewayRoutesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListGatewayRoutesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListGatewayRoutes
forall a. Maybe a
Prelude.Nothing
    | [GatewayRouteRef] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListGatewayRoutes
ListGatewayRoutesResponse
rs ListGatewayRoutesResponse
-> Getting
     [GatewayRouteRef] ListGatewayRoutesResponse [GatewayRouteRef]
-> [GatewayRouteRef]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [GatewayRouteRef] ListGatewayRoutesResponse [GatewayRouteRef]
Lens' ListGatewayRoutesResponse [GatewayRouteRef]
listGatewayRoutesResponse_gatewayRoutes) =
      Maybe ListGatewayRoutes
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListGatewayRoutes -> Maybe ListGatewayRoutes
forall a. a -> Maybe a
Prelude.Just (ListGatewayRoutes -> Maybe ListGatewayRoutes)
-> ListGatewayRoutes -> Maybe ListGatewayRoutes
forall a b. (a -> b) -> a -> b
Prelude.$
        ListGatewayRoutes
rq
          ListGatewayRoutes
-> (ListGatewayRoutes -> ListGatewayRoutes) -> ListGatewayRoutes
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListGatewayRoutes -> Identity ListGatewayRoutes
Lens ListGatewayRoutes ListGatewayRoutes (Maybe Text) (Maybe Text)
listGatewayRoutes_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListGatewayRoutes -> Identity ListGatewayRoutes)
-> Maybe Text -> ListGatewayRoutes -> ListGatewayRoutes
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListGatewayRoutes
ListGatewayRoutesResponse
rs
          ListGatewayRoutesResponse
-> Getting (First Text) ListGatewayRoutesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListGatewayRoutesResponse
-> Const (First Text) ListGatewayRoutesResponse
Lens' ListGatewayRoutesResponse (Maybe Text)
listGatewayRoutesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListGatewayRoutesResponse
 -> Const (First Text) ListGatewayRoutesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListGatewayRoutesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListGatewayRoutes where
  type
    AWSResponse ListGatewayRoutes =
      ListGatewayRoutesResponse
  request :: ListGatewayRoutes -> Request ListGatewayRoutes
request = Service -> ListGatewayRoutes -> Request ListGatewayRoutes
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListGatewayRoutes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListGatewayRoutes)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListGatewayRoutes))
-> Logger
-> Service
-> Proxy ListGatewayRoutes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListGatewayRoutes)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> 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'
            (Maybe Text
 -> Int -> [GatewayRouteRef] -> ListGatewayRoutesResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> [GatewayRouteRef] -> ListGatewayRoutesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either
  String (Int -> [GatewayRouteRef] -> ListGatewayRoutesResponse)
-> Either String Int
-> Either String ([GatewayRouteRef] -> ListGatewayRoutesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either String ([GatewayRouteRef] -> ListGatewayRoutesResponse)
-> Either String [GatewayRouteRef]
-> Either String ListGatewayRoutesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [GatewayRouteRef])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"gatewayRoutes" Either String (Maybe [GatewayRouteRef])
-> [GatewayRouteRef] -> Either String [GatewayRouteRef]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [GatewayRouteRef]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListGatewayRoutes

instance Prelude.NFData ListGatewayRoutes

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

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

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

-- | /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
(ListGatewayRoutesResponse -> ListGatewayRoutesResponse -> Bool)
-> (ListGatewayRoutesResponse -> ListGatewayRoutesResponse -> Bool)
-> Eq ListGatewayRoutesResponse
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]
(Int -> ReadS ListGatewayRoutesResponse)
-> ReadS [ListGatewayRoutesResponse]
-> ReadPrec ListGatewayRoutesResponse
-> ReadPrec [ListGatewayRoutesResponse]
-> Read 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
(Int -> ListGatewayRoutesResponse -> ShowS)
-> (ListGatewayRoutesResponse -> String)
-> ([ListGatewayRoutesResponse] -> ShowS)
-> Show ListGatewayRoutesResponse
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.
 ListGatewayRoutesResponse -> Rep ListGatewayRoutesResponse x)
-> (forall x.
    Rep ListGatewayRoutesResponse x -> ListGatewayRoutesResponse)
-> Generic ListGatewayRoutesResponse
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' :: Maybe Text -> Int -> [GatewayRouteRef] -> ListGatewayRoutesResponse
ListGatewayRoutesResponse'
    { $sel:nextToken:ListGatewayRoutesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListGatewayRoutesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:gatewayRoutes:ListGatewayRoutesResponse' :: [GatewayRouteRef]
gatewayRoutes = [GatewayRouteRef]
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 :: (Maybe Text -> f (Maybe Text))
-> ListGatewayRoutesResponse -> f ListGatewayRoutesResponse
listGatewayRoutesResponse_nextToken = (ListGatewayRoutesResponse -> Maybe Text)
-> (ListGatewayRoutesResponse
    -> Maybe Text -> ListGatewayRoutesResponse)
-> Lens' ListGatewayRoutesResponse (Maybe Text)
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 :: (Int -> f Int)
-> ListGatewayRoutesResponse -> f ListGatewayRoutesResponse
listGatewayRoutesResponse_httpStatus = (ListGatewayRoutesResponse -> Int)
-> (ListGatewayRoutesResponse -> Int -> ListGatewayRoutesResponse)
-> Lens ListGatewayRoutesResponse ListGatewayRoutesResponse Int Int
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 :: ([GatewayRouteRef] -> f [GatewayRouteRef])
-> ListGatewayRoutesResponse -> f ListGatewayRoutesResponse
listGatewayRoutesResponse_gatewayRoutes = (ListGatewayRoutesResponse -> [GatewayRouteRef])
-> (ListGatewayRoutesResponse
    -> [GatewayRouteRef] -> ListGatewayRoutesResponse)
-> Lens' ListGatewayRoutesResponse [GatewayRouteRef]
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) (([GatewayRouteRef] -> f [GatewayRouteRef])
 -> ListGatewayRoutesResponse -> f ListGatewayRoutesResponse)
-> (([GatewayRouteRef] -> f [GatewayRouteRef])
    -> [GatewayRouteRef] -> f [GatewayRouteRef])
-> ([GatewayRouteRef] -> f [GatewayRouteRef])
-> ListGatewayRoutesResponse
-> f ListGatewayRoutesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([GatewayRouteRef] -> f [GatewayRouteRef])
-> [GatewayRouteRef] -> f [GatewayRouteRef]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListGatewayRoutesResponse