{-# 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.ListVirtualRouters
-- 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 virtual routers in a service mesh.
--
-- This operation returns paginated results.
module Amazonka.AppMesh.ListVirtualRouters
  ( -- * Creating a Request
    ListVirtualRouters (..),
    newListVirtualRouters,

    -- * Request Lenses
    listVirtualRouters_meshOwner,
    listVirtualRouters_nextToken,
    listVirtualRouters_limit,
    listVirtualRouters_meshName,

    -- * Destructuring the Response
    ListVirtualRoutersResponse (..),
    newListVirtualRoutersResponse,

    -- * Response Lenses
    listVirtualRoutersResponse_nextToken,
    listVirtualRoutersResponse_httpStatus,
    listVirtualRoutersResponse_virtualRouters,
  )
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:/ 'newListVirtualRouters' smart constructor.
data ListVirtualRouters = ListVirtualRouters'
  { -- | 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>.
    ListVirtualRouters -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
    -- | The @nextToken@ value returned from a previous paginated
    -- @ListVirtualRouters@ 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.
    ListVirtualRouters -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results returned by @ListVirtualRouters@ in
    -- paginated output. When you use this parameter, @ListVirtualRouters@
    -- 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 @ListVirtualRouters@ request with the
    -- returned @nextToken@ value. This value can be between 1 and 100. If you
    -- don\'t use this parameter, @ListVirtualRouters@ returns up to 100
    -- results and a @nextToken@ value if applicable.
    ListVirtualRouters -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The name of the service mesh to list virtual routers in.
    ListVirtualRouters -> Text
meshName :: Prelude.Text
  }
  deriving (ListVirtualRouters -> ListVirtualRouters -> Bool
(ListVirtualRouters -> ListVirtualRouters -> Bool)
-> (ListVirtualRouters -> ListVirtualRouters -> Bool)
-> Eq ListVirtualRouters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVirtualRouters -> ListVirtualRouters -> Bool
$c/= :: ListVirtualRouters -> ListVirtualRouters -> Bool
== :: ListVirtualRouters -> ListVirtualRouters -> Bool
$c== :: ListVirtualRouters -> ListVirtualRouters -> Bool
Prelude.Eq, ReadPrec [ListVirtualRouters]
ReadPrec ListVirtualRouters
Int -> ReadS ListVirtualRouters
ReadS [ListVirtualRouters]
(Int -> ReadS ListVirtualRouters)
-> ReadS [ListVirtualRouters]
-> ReadPrec ListVirtualRouters
-> ReadPrec [ListVirtualRouters]
-> Read ListVirtualRouters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVirtualRouters]
$creadListPrec :: ReadPrec [ListVirtualRouters]
readPrec :: ReadPrec ListVirtualRouters
$creadPrec :: ReadPrec ListVirtualRouters
readList :: ReadS [ListVirtualRouters]
$creadList :: ReadS [ListVirtualRouters]
readsPrec :: Int -> ReadS ListVirtualRouters
$creadsPrec :: Int -> ReadS ListVirtualRouters
Prelude.Read, Int -> ListVirtualRouters -> ShowS
[ListVirtualRouters] -> ShowS
ListVirtualRouters -> String
(Int -> ListVirtualRouters -> ShowS)
-> (ListVirtualRouters -> String)
-> ([ListVirtualRouters] -> ShowS)
-> Show ListVirtualRouters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVirtualRouters] -> ShowS
$cshowList :: [ListVirtualRouters] -> ShowS
show :: ListVirtualRouters -> String
$cshow :: ListVirtualRouters -> String
showsPrec :: Int -> ListVirtualRouters -> ShowS
$cshowsPrec :: Int -> ListVirtualRouters -> ShowS
Prelude.Show, (forall x. ListVirtualRouters -> Rep ListVirtualRouters x)
-> (forall x. Rep ListVirtualRouters x -> ListVirtualRouters)
-> Generic ListVirtualRouters
forall x. Rep ListVirtualRouters x -> ListVirtualRouters
forall x. ListVirtualRouters -> Rep ListVirtualRouters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVirtualRouters x -> ListVirtualRouters
$cfrom :: forall x. ListVirtualRouters -> Rep ListVirtualRouters x
Prelude.Generic)

-- |
-- Create a value of 'ListVirtualRouters' 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', 'listVirtualRouters_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', 'listVirtualRouters_nextToken' - The @nextToken@ value returned from a previous paginated
-- @ListVirtualRouters@ 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', 'listVirtualRouters_limit' - The maximum number of results returned by @ListVirtualRouters@ in
-- paginated output. When you use this parameter, @ListVirtualRouters@
-- 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 @ListVirtualRouters@ request with the
-- returned @nextToken@ value. This value can be between 1 and 100. If you
-- don\'t use this parameter, @ListVirtualRouters@ returns up to 100
-- results and a @nextToken@ value if applicable.
--
-- 'meshName', 'listVirtualRouters_meshName' - The name of the service mesh to list virtual routers in.
newListVirtualRouters ::
  -- | 'meshName'
  Prelude.Text ->
  ListVirtualRouters
newListVirtualRouters :: Text -> ListVirtualRouters
newListVirtualRouters Text
pMeshName_ =
  ListVirtualRouters' :: Maybe Text
-> Maybe Text -> Maybe Natural -> Text -> ListVirtualRouters
ListVirtualRouters'
    { $sel:meshOwner:ListVirtualRouters' :: Maybe Text
meshOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListVirtualRouters' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListVirtualRouters' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:meshName:ListVirtualRouters' :: Text
meshName = Text
pMeshName_
    }

-- | 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>.
listVirtualRouters_meshOwner :: Lens.Lens' ListVirtualRouters (Prelude.Maybe Prelude.Text)
listVirtualRouters_meshOwner :: (Maybe Text -> f (Maybe Text))
-> ListVirtualRouters -> f ListVirtualRouters
listVirtualRouters_meshOwner = (ListVirtualRouters -> Maybe Text)
-> (ListVirtualRouters -> Maybe Text -> ListVirtualRouters)
-> Lens
     ListVirtualRouters ListVirtualRouters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRouters' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: ListVirtualRouters
s@ListVirtualRouters' {} Maybe Text
a -> ListVirtualRouters
s {$sel:meshOwner:ListVirtualRouters' :: Maybe Text
meshOwner = Maybe Text
a} :: ListVirtualRouters)

-- | The @nextToken@ value returned from a previous paginated
-- @ListVirtualRouters@ 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.
listVirtualRouters_nextToken :: Lens.Lens' ListVirtualRouters (Prelude.Maybe Prelude.Text)
listVirtualRouters_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListVirtualRouters -> f ListVirtualRouters
listVirtualRouters_nextToken = (ListVirtualRouters -> Maybe Text)
-> (ListVirtualRouters -> Maybe Text -> ListVirtualRouters)
-> Lens
     ListVirtualRouters ListVirtualRouters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRouters' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVirtualRouters
s@ListVirtualRouters' {} Maybe Text
a -> ListVirtualRouters
s {$sel:nextToken:ListVirtualRouters' :: Maybe Text
nextToken = Maybe Text
a} :: ListVirtualRouters)

-- | The maximum number of results returned by @ListVirtualRouters@ in
-- paginated output. When you use this parameter, @ListVirtualRouters@
-- 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 @ListVirtualRouters@ request with the
-- returned @nextToken@ value. This value can be between 1 and 100. If you
-- don\'t use this parameter, @ListVirtualRouters@ returns up to 100
-- results and a @nextToken@ value if applicable.
listVirtualRouters_limit :: Lens.Lens' ListVirtualRouters (Prelude.Maybe Prelude.Natural)
listVirtualRouters_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListVirtualRouters -> f ListVirtualRouters
listVirtualRouters_limit = (ListVirtualRouters -> Maybe Natural)
-> (ListVirtualRouters -> Maybe Natural -> ListVirtualRouters)
-> Lens
     ListVirtualRouters
     ListVirtualRouters
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRouters' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListVirtualRouters' :: ListVirtualRouters -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListVirtualRouters
s@ListVirtualRouters' {} Maybe Natural
a -> ListVirtualRouters
s {$sel:limit:ListVirtualRouters' :: Maybe Natural
limit = Maybe Natural
a} :: ListVirtualRouters)

-- | The name of the service mesh to list virtual routers in.
listVirtualRouters_meshName :: Lens.Lens' ListVirtualRouters Prelude.Text
listVirtualRouters_meshName :: (Text -> f Text) -> ListVirtualRouters -> f ListVirtualRouters
listVirtualRouters_meshName = (ListVirtualRouters -> Text)
-> (ListVirtualRouters -> Text -> ListVirtualRouters)
-> Lens ListVirtualRouters ListVirtualRouters Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRouters' {Text
meshName :: Text
$sel:meshName:ListVirtualRouters' :: ListVirtualRouters -> Text
meshName} -> Text
meshName) (\s :: ListVirtualRouters
s@ListVirtualRouters' {} Text
a -> ListVirtualRouters
s {$sel:meshName:ListVirtualRouters' :: Text
meshName = Text
a} :: ListVirtualRouters)

instance Core.AWSPager ListVirtualRouters where
  page :: ListVirtualRouters
-> AWSResponse ListVirtualRouters -> Maybe ListVirtualRouters
page ListVirtualRouters
rq AWSResponse ListVirtualRouters
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListVirtualRouters
ListVirtualRoutersResponse
rs
            ListVirtualRoutersResponse
-> Getting (First Text) ListVirtualRoutersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListVirtualRoutersResponse
-> Const (First Text) ListVirtualRoutersResponse
Lens' ListVirtualRoutersResponse (Maybe Text)
listVirtualRoutersResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListVirtualRoutersResponse
 -> Const (First Text) ListVirtualRoutersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListVirtualRoutersResponse 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 ListVirtualRouters
forall a. Maybe a
Prelude.Nothing
    | [VirtualRouterRef] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListVirtualRouters
ListVirtualRoutersResponse
rs
            ListVirtualRoutersResponse
-> Getting
     [VirtualRouterRef] ListVirtualRoutersResponse [VirtualRouterRef]
-> [VirtualRouterRef]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [VirtualRouterRef] ListVirtualRoutersResponse [VirtualRouterRef]
Lens' ListVirtualRoutersResponse [VirtualRouterRef]
listVirtualRoutersResponse_virtualRouters
        ) =
      Maybe ListVirtualRouters
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListVirtualRouters -> Maybe ListVirtualRouters
forall a. a -> Maybe a
Prelude.Just (ListVirtualRouters -> Maybe ListVirtualRouters)
-> ListVirtualRouters -> Maybe ListVirtualRouters
forall a b. (a -> b) -> a -> b
Prelude.$
        ListVirtualRouters
rq
          ListVirtualRouters
-> (ListVirtualRouters -> ListVirtualRouters) -> ListVirtualRouters
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListVirtualRouters -> Identity ListVirtualRouters
Lens
  ListVirtualRouters ListVirtualRouters (Maybe Text) (Maybe Text)
listVirtualRouters_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListVirtualRouters -> Identity ListVirtualRouters)
-> Maybe Text -> ListVirtualRouters -> ListVirtualRouters
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVirtualRouters
ListVirtualRoutersResponse
rs
          ListVirtualRoutersResponse
-> Getting (First Text) ListVirtualRoutersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListVirtualRoutersResponse
-> Const (First Text) ListVirtualRoutersResponse
Lens' ListVirtualRoutersResponse (Maybe Text)
listVirtualRoutersResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListVirtualRoutersResponse
 -> Const (First Text) ListVirtualRoutersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListVirtualRoutersResponse 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 ListVirtualRouters where
  type
    AWSResponse ListVirtualRouters =
      ListVirtualRoutersResponse
  request :: ListVirtualRouters -> Request ListVirtualRouters
request = Service -> ListVirtualRouters -> Request ListVirtualRouters
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListVirtualRouters
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListVirtualRouters)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListVirtualRouters))
-> Logger
-> Service
-> Proxy ListVirtualRouters
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListVirtualRouters)))
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 -> [VirtualRouterRef] -> ListVirtualRoutersResponse
ListVirtualRoutersResponse'
            (Maybe Text
 -> Int -> [VirtualRouterRef] -> ListVirtualRoutersResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> [VirtualRouterRef] -> ListVirtualRoutersResponse)
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 -> [VirtualRouterRef] -> ListVirtualRoutersResponse)
-> Either String Int
-> Either String ([VirtualRouterRef] -> ListVirtualRoutersResponse)
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 ([VirtualRouterRef] -> ListVirtualRoutersResponse)
-> Either String [VirtualRouterRef]
-> Either String ListVirtualRoutersResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [VirtualRouterRef])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"virtualRouters"
                            Either String (Maybe [VirtualRouterRef])
-> [VirtualRouterRef] -> Either String [VirtualRouterRef]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [VirtualRouterRef]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListVirtualRouters

instance Prelude.NFData ListVirtualRouters

instance Core.ToHeaders ListVirtualRouters where
  toHeaders :: ListVirtualRouters -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListVirtualRouters -> 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 ListVirtualRouters where
  toPath :: ListVirtualRouters -> ByteString
toPath ListVirtualRouters' {Maybe Natural
Maybe Text
Text
meshName :: Text
limit :: Maybe Natural
nextToken :: Maybe Text
meshOwner :: Maybe Text
$sel:meshName:ListVirtualRouters' :: ListVirtualRouters -> Text
$sel:limit:ListVirtualRouters' :: ListVirtualRouters -> Maybe Natural
$sel:nextToken:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:meshOwner:ListVirtualRouters' :: ListVirtualRouters -> 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
"/virtualRouters"
      ]

instance Core.ToQuery ListVirtualRouters where
  toQuery :: ListVirtualRouters -> QueryString
toQuery ListVirtualRouters' {Maybe Natural
Maybe Text
Text
meshName :: Text
limit :: Maybe Natural
nextToken :: Maybe Text
meshOwner :: Maybe Text
$sel:meshName:ListVirtualRouters' :: ListVirtualRouters -> Text
$sel:limit:ListVirtualRouters' :: ListVirtualRouters -> Maybe Natural
$sel:nextToken:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:meshOwner:ListVirtualRouters' :: ListVirtualRouters -> 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:/ 'newListVirtualRoutersResponse' smart constructor.
data ListVirtualRoutersResponse = ListVirtualRoutersResponse'
  { -- | The @nextToken@ value to include in a future @ListVirtualRouters@
    -- request. When the results of a @ListVirtualRouters@ 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.
    ListVirtualRoutersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListVirtualRoutersResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of existing virtual routers for the specified service mesh.
    ListVirtualRoutersResponse -> [VirtualRouterRef]
virtualRouters :: [VirtualRouterRef]
  }
  deriving (ListVirtualRoutersResponse -> ListVirtualRoutersResponse -> Bool
(ListVirtualRoutersResponse -> ListVirtualRoutersResponse -> Bool)
-> (ListVirtualRoutersResponse
    -> ListVirtualRoutersResponse -> Bool)
-> Eq ListVirtualRoutersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVirtualRoutersResponse -> ListVirtualRoutersResponse -> Bool
$c/= :: ListVirtualRoutersResponse -> ListVirtualRoutersResponse -> Bool
== :: ListVirtualRoutersResponse -> ListVirtualRoutersResponse -> Bool
$c== :: ListVirtualRoutersResponse -> ListVirtualRoutersResponse -> Bool
Prelude.Eq, ReadPrec [ListVirtualRoutersResponse]
ReadPrec ListVirtualRoutersResponse
Int -> ReadS ListVirtualRoutersResponse
ReadS [ListVirtualRoutersResponse]
(Int -> ReadS ListVirtualRoutersResponse)
-> ReadS [ListVirtualRoutersResponse]
-> ReadPrec ListVirtualRoutersResponse
-> ReadPrec [ListVirtualRoutersResponse]
-> Read ListVirtualRoutersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVirtualRoutersResponse]
$creadListPrec :: ReadPrec [ListVirtualRoutersResponse]
readPrec :: ReadPrec ListVirtualRoutersResponse
$creadPrec :: ReadPrec ListVirtualRoutersResponse
readList :: ReadS [ListVirtualRoutersResponse]
$creadList :: ReadS [ListVirtualRoutersResponse]
readsPrec :: Int -> ReadS ListVirtualRoutersResponse
$creadsPrec :: Int -> ReadS ListVirtualRoutersResponse
Prelude.Read, Int -> ListVirtualRoutersResponse -> ShowS
[ListVirtualRoutersResponse] -> ShowS
ListVirtualRoutersResponse -> String
(Int -> ListVirtualRoutersResponse -> ShowS)
-> (ListVirtualRoutersResponse -> String)
-> ([ListVirtualRoutersResponse] -> ShowS)
-> Show ListVirtualRoutersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVirtualRoutersResponse] -> ShowS
$cshowList :: [ListVirtualRoutersResponse] -> ShowS
show :: ListVirtualRoutersResponse -> String
$cshow :: ListVirtualRoutersResponse -> String
showsPrec :: Int -> ListVirtualRoutersResponse -> ShowS
$cshowsPrec :: Int -> ListVirtualRoutersResponse -> ShowS
Prelude.Show, (forall x.
 ListVirtualRoutersResponse -> Rep ListVirtualRoutersResponse x)
-> (forall x.
    Rep ListVirtualRoutersResponse x -> ListVirtualRoutersResponse)
-> Generic ListVirtualRoutersResponse
forall x.
Rep ListVirtualRoutersResponse x -> ListVirtualRoutersResponse
forall x.
ListVirtualRoutersResponse -> Rep ListVirtualRoutersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVirtualRoutersResponse x -> ListVirtualRoutersResponse
$cfrom :: forall x.
ListVirtualRoutersResponse -> Rep ListVirtualRoutersResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListVirtualRoutersResponse' 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', 'listVirtualRoutersResponse_nextToken' - The @nextToken@ value to include in a future @ListVirtualRouters@
-- request. When the results of a @ListVirtualRouters@ 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', 'listVirtualRoutersResponse_httpStatus' - The response's http status code.
--
-- 'virtualRouters', 'listVirtualRoutersResponse_virtualRouters' - The list of existing virtual routers for the specified service mesh.
newListVirtualRoutersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListVirtualRoutersResponse
newListVirtualRoutersResponse :: Int -> ListVirtualRoutersResponse
newListVirtualRoutersResponse Int
pHttpStatus_ =
  ListVirtualRoutersResponse' :: Maybe Text
-> Int -> [VirtualRouterRef] -> ListVirtualRoutersResponse
ListVirtualRoutersResponse'
    { $sel:nextToken:ListVirtualRoutersResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListVirtualRoutersResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:virtualRouters:ListVirtualRoutersResponse' :: [VirtualRouterRef]
virtualRouters = [VirtualRouterRef]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The @nextToken@ value to include in a future @ListVirtualRouters@
-- request. When the results of a @ListVirtualRouters@ 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.
listVirtualRoutersResponse_nextToken :: Lens.Lens' ListVirtualRoutersResponse (Prelude.Maybe Prelude.Text)
listVirtualRoutersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListVirtualRoutersResponse -> f ListVirtualRoutersResponse
listVirtualRoutersResponse_nextToken = (ListVirtualRoutersResponse -> Maybe Text)
-> (ListVirtualRoutersResponse
    -> Maybe Text -> ListVirtualRoutersResponse)
-> Lens' ListVirtualRoutersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRoutersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVirtualRoutersResponse' :: ListVirtualRoutersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVirtualRoutersResponse
s@ListVirtualRoutersResponse' {} Maybe Text
a -> ListVirtualRoutersResponse
s {$sel:nextToken:ListVirtualRoutersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListVirtualRoutersResponse)

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

-- | The list of existing virtual routers for the specified service mesh.
listVirtualRoutersResponse_virtualRouters :: Lens.Lens' ListVirtualRoutersResponse [VirtualRouterRef]
listVirtualRoutersResponse_virtualRouters :: ([VirtualRouterRef] -> f [VirtualRouterRef])
-> ListVirtualRoutersResponse -> f ListVirtualRoutersResponse
listVirtualRoutersResponse_virtualRouters = (ListVirtualRoutersResponse -> [VirtualRouterRef])
-> (ListVirtualRoutersResponse
    -> [VirtualRouterRef] -> ListVirtualRoutersResponse)
-> Lens' ListVirtualRoutersResponse [VirtualRouterRef]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRoutersResponse' {[VirtualRouterRef]
virtualRouters :: [VirtualRouterRef]
$sel:virtualRouters:ListVirtualRoutersResponse' :: ListVirtualRoutersResponse -> [VirtualRouterRef]
virtualRouters} -> [VirtualRouterRef]
virtualRouters) (\s :: ListVirtualRoutersResponse
s@ListVirtualRoutersResponse' {} [VirtualRouterRef]
a -> ListVirtualRoutersResponse
s {$sel:virtualRouters:ListVirtualRoutersResponse' :: [VirtualRouterRef]
virtualRouters = [VirtualRouterRef]
a} :: ListVirtualRoutersResponse) (([VirtualRouterRef] -> f [VirtualRouterRef])
 -> ListVirtualRoutersResponse -> f ListVirtualRoutersResponse)
-> (([VirtualRouterRef] -> f [VirtualRouterRef])
    -> [VirtualRouterRef] -> f [VirtualRouterRef])
-> ([VirtualRouterRef] -> f [VirtualRouterRef])
-> ListVirtualRoutersResponse
-> f ListVirtualRoutersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([VirtualRouterRef] -> f [VirtualRouterRef])
-> [VirtualRouterRef] -> f [VirtualRouterRef]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListVirtualRoutersResponse