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

    -- * Request Lenses
    listVirtualRouters_limit,
    listVirtualRouters_meshOwner,
    listVirtualRouters_nextToken,
    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.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:/ 'newListVirtualRouters' smart constructor.
data ListVirtualRouters = 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 -> 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>.
    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 name of the service mesh to list virtual routers in.
    ListVirtualRouters -> Text
meshName :: Prelude.Text
  }
  deriving (ListVirtualRouters -> ListVirtualRouters -> Bool
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]
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
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. 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:
--
-- '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.
--
-- 'meshOwner', 'listVirtualRouters_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', '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.
--
-- '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'
    { $sel:limit:ListVirtualRouters' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
      $sel:meshOwner:ListVirtualRouters' :: Maybe Text
meshOwner = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListVirtualRouters' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:meshName:ListVirtualRouters' :: Text
meshName = Text
pMeshName_
    }

-- | 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 :: Lens' ListVirtualRouters (Maybe Natural)
listVirtualRouters_limit = 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 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>.
listVirtualRouters_meshOwner :: Lens.Lens' ListVirtualRouters (Prelude.Maybe Prelude.Text)
listVirtualRouters_meshOwner :: Lens' ListVirtualRouters (Maybe Text)
listVirtualRouters_meshOwner = 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 :: Lens' ListVirtualRouters (Maybe Text)
listVirtualRouters_nextToken = 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 name of the service mesh to list virtual routers in.
listVirtualRouters_meshName :: Lens.Lens' ListVirtualRouters Prelude.Text
listVirtualRouters_meshName :: Lens' ListVirtualRouters Text
listVirtualRouters_meshName = 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
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListVirtualRouters
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVirtualRoutersResponse (Maybe Text)
listVirtualRoutersResponse_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 ListVirtualRouters
rs
            forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListVirtualRoutersResponse [VirtualRouterRef]
listVirtualRoutersResponse_virtualRouters
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListVirtualRouters
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListVirtualRouters (Maybe Text)
listVirtualRouters_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVirtualRouters
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVirtualRoutersResponse (Maybe Text)
listVirtualRoutersResponse_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 ListVirtualRouters where
  type
    AWSResponse ListVirtualRouters =
      ListVirtualRoutersResponse
  request :: (Service -> Service)
-> ListVirtualRouters -> Request ListVirtualRouters
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 ListVirtualRouters
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListVirtualRouters)))
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 -> [VirtualRouterRef] -> ListVirtualRoutersResponse
ListVirtualRoutersResponse'
            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
"virtualRouters"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListVirtualRouters where
  hashWithSalt :: Int -> ListVirtualRouters -> Int
hashWithSalt Int
_salt ListVirtualRouters' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualRouters' :: ListVirtualRouters -> Text
$sel:nextToken:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:meshOwner:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:limit:ListVirtualRouters' :: ListVirtualRouters -> 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

instance Prelude.NFData ListVirtualRouters where
  rnf :: ListVirtualRouters -> ()
rnf ListVirtualRouters' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualRouters' :: ListVirtualRouters -> Text
$sel:nextToken:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:meshOwner:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:limit:ListVirtualRouters' :: ListVirtualRouters -> 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

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

instance Data.ToQuery ListVirtualRouters where
  toQuery :: ListVirtualRouters -> QueryString
toQuery ListVirtualRouters' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualRouters' :: ListVirtualRouters -> Text
$sel:nextToken:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:meshOwner:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:limit:ListVirtualRouters' :: ListVirtualRouters -> 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:/ '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
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]
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
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.
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'
    { $sel:nextToken:ListVirtualRoutersResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListVirtualRoutersResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:virtualRouters:ListVirtualRoutersResponse' :: [VirtualRouterRef]
virtualRouters = 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 :: Lens' ListVirtualRoutersResponse (Maybe Text)
listVirtualRoutersResponse_nextToken = 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 :: Lens' ListVirtualRoutersResponse Int
listVirtualRoutersResponse_httpStatus = 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 :: Lens' ListVirtualRoutersResponse [VirtualRouterRef]
listVirtualRoutersResponse_virtualRouters = 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) 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 ListVirtualRoutersResponse where
  rnf :: ListVirtualRoutersResponse -> ()
rnf ListVirtualRoutersResponse' {Int
[VirtualRouterRef]
Maybe Text
virtualRouters :: [VirtualRouterRef]
httpStatus :: Int
nextToken :: Maybe Text
$sel:virtualRouters:ListVirtualRoutersResponse' :: ListVirtualRoutersResponse -> [VirtualRouterRef]
$sel:httpStatus:ListVirtualRoutersResponse' :: ListVirtualRoutersResponse -> Int
$sel:nextToken:ListVirtualRoutersResponse' :: ListVirtualRoutersResponse -> 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 [VirtualRouterRef]
virtualRouters