{-# 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.ListVirtualNodes
-- 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 nodes.
--
-- This operation returns paginated results.
module Amazonka.AppMesh.ListVirtualNodes
  ( -- * Creating a Request
    ListVirtualNodes (..),
    newListVirtualNodes,

    -- * Request Lenses
    listVirtualNodes_meshOwner,
    listVirtualNodes_nextToken,
    listVirtualNodes_limit,
    listVirtualNodes_meshName,

    -- * Destructuring the Response
    ListVirtualNodesResponse (..),
    newListVirtualNodesResponse,

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

-- |
-- Create a value of 'ListVirtualNodes' 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', 'listVirtualNodes_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', 'listVirtualNodes_nextToken' - The @nextToken@ value returned from a previous paginated
-- @ListVirtualNodes@ 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', 'listVirtualNodes_limit' - The maximum number of results returned by @ListVirtualNodes@ in
-- paginated output. When you use this parameter, @ListVirtualNodes@
-- 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 @ListVirtualNodes@ request with the returned
-- @nextToken@ value. This value can be between 1 and 100. If you don\'t
-- use this parameter, @ListVirtualNodes@ returns up to 100 results and a
-- @nextToken@ value if applicable.
--
-- 'meshName', 'listVirtualNodes_meshName' - The name of the service mesh to list virtual nodes in.
newListVirtualNodes ::
  -- | 'meshName'
  Prelude.Text ->
  ListVirtualNodes
newListVirtualNodes :: Text -> ListVirtualNodes
newListVirtualNodes Text
pMeshName_ =
  ListVirtualNodes' :: Maybe Text
-> Maybe Text -> Maybe Natural -> Text -> ListVirtualNodes
ListVirtualNodes'
    { $sel:meshOwner:ListVirtualNodes' :: Maybe Text
meshOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListVirtualNodes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListVirtualNodes' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:meshName:ListVirtualNodes' :: 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>.
listVirtualNodes_meshOwner :: Lens.Lens' ListVirtualNodes (Prelude.Maybe Prelude.Text)
listVirtualNodes_meshOwner :: (Maybe Text -> f (Maybe Text))
-> ListVirtualNodes -> f ListVirtualNodes
listVirtualNodes_meshOwner = (ListVirtualNodes -> Maybe Text)
-> (ListVirtualNodes -> Maybe Text -> ListVirtualNodes)
-> Lens ListVirtualNodes ListVirtualNodes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualNodes' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:ListVirtualNodes' :: ListVirtualNodes -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: ListVirtualNodes
s@ListVirtualNodes' {} Maybe Text
a -> ListVirtualNodes
s {$sel:meshOwner:ListVirtualNodes' :: Maybe Text
meshOwner = Maybe Text
a} :: ListVirtualNodes)

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

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

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

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

instance Prelude.Hashable ListVirtualNodes

instance Prelude.NFData ListVirtualNodes

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

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

-- |
-- Create a value of 'ListVirtualNodesResponse' 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', 'listVirtualNodesResponse_nextToken' - The @nextToken@ value to include in a future @ListVirtualNodes@ request.
-- When the results of a @ListVirtualNodes@ 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', 'listVirtualNodesResponse_httpStatus' - The response's http status code.
--
-- 'virtualNodes', 'listVirtualNodesResponse_virtualNodes' - The list of existing virtual nodes for the specified service mesh.
newListVirtualNodesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListVirtualNodesResponse
newListVirtualNodesResponse :: Int -> ListVirtualNodesResponse
newListVirtualNodesResponse Int
pHttpStatus_ =
  ListVirtualNodesResponse' :: Maybe Text -> Int -> [VirtualNodeRef] -> ListVirtualNodesResponse
ListVirtualNodesResponse'
    { $sel:nextToken:ListVirtualNodesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListVirtualNodesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:virtualNodes:ListVirtualNodesResponse' :: [VirtualNodeRef]
virtualNodes = [VirtualNodeRef]
forall a. Monoid a => a
Prelude.mempty
    }

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

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

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

instance Prelude.NFData ListVirtualNodesResponse