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

    -- * Request Lenses
    listVirtualServices_limit,
    listVirtualServices_meshOwner,
    listVirtualServices_nextToken,
    listVirtualServices_meshName,

    -- * Destructuring the Response
    ListVirtualServicesResponse (..),
    newListVirtualServicesResponse,

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

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

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

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

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

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

instance Core.AWSPager ListVirtualServices where
  page :: ListVirtualServices
-> AWSResponse ListVirtualServices -> Maybe ListVirtualServices
page ListVirtualServices
rq AWSResponse ListVirtualServices
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListVirtualServices
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVirtualServicesResponse (Maybe Text)
listVirtualServicesResponse_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 ListVirtualServices
rs
            forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListVirtualServicesResponse [VirtualServiceRef]
listVirtualServicesResponse_virtualServices
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListVirtualServices
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListVirtualServices (Maybe Text)
listVirtualServices_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVirtualServices
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVirtualServicesResponse (Maybe Text)
listVirtualServicesResponse_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 ListVirtualServices where
  type
    AWSResponse ListVirtualServices =
      ListVirtualServicesResponse
  request :: (Service -> Service)
-> ListVirtualServices -> Request ListVirtualServices
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 ListVirtualServices
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListVirtualServices)))
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 -> [VirtualServiceRef] -> ListVirtualServicesResponse
ListVirtualServicesResponse'
            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
"virtualServices"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListVirtualServices where
  hashWithSalt :: Int -> ListVirtualServices -> Int
hashWithSalt Int
_salt ListVirtualServices' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualServices' :: ListVirtualServices -> Text
$sel:nextToken:ListVirtualServices' :: ListVirtualServices -> Maybe Text
$sel:meshOwner:ListVirtualServices' :: ListVirtualServices -> Maybe Text
$sel:limit:ListVirtualServices' :: ListVirtualServices -> 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 ListVirtualServices where
  rnf :: ListVirtualServices -> ()
rnf ListVirtualServices' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualServices' :: ListVirtualServices -> Text
$sel:nextToken:ListVirtualServices' :: ListVirtualServices -> Maybe Text
$sel:meshOwner:ListVirtualServices' :: ListVirtualServices -> Maybe Text
$sel:limit:ListVirtualServices' :: ListVirtualServices -> 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 ListVirtualServices where
  toHeaders :: ListVirtualServices -> 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 ListVirtualServices where
  toPath :: ListVirtualServices -> ByteString
toPath ListVirtualServices' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualServices' :: ListVirtualServices -> Text
$sel:nextToken:ListVirtualServices' :: ListVirtualServices -> Maybe Text
$sel:meshOwner:ListVirtualServices' :: ListVirtualServices -> Maybe Text
$sel:limit:ListVirtualServices' :: ListVirtualServices -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v20190125/meshes/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
meshName,
        ByteString
"/virtualServices"
      ]

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

-- |
-- Create a value of 'ListVirtualServicesResponse' 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', 'listVirtualServicesResponse_nextToken' - The @nextToken@ value to include in a future @ListVirtualServices@
-- request. When the results of a @ListVirtualServices@ 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', 'listVirtualServicesResponse_httpStatus' - The response's http status code.
--
-- 'virtualServices', 'listVirtualServicesResponse_virtualServices' - The list of existing virtual services for the specified service mesh.
newListVirtualServicesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListVirtualServicesResponse
newListVirtualServicesResponse :: Int -> ListVirtualServicesResponse
newListVirtualServicesResponse Int
pHttpStatus_ =
  ListVirtualServicesResponse'
    { $sel:nextToken:ListVirtualServicesResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListVirtualServicesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:virtualServices:ListVirtualServicesResponse' :: [VirtualServiceRef]
virtualServices = forall a. Monoid a => a
Prelude.mempty
    }

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

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

-- | The list of existing virtual services for the specified service mesh.
listVirtualServicesResponse_virtualServices :: Lens.Lens' ListVirtualServicesResponse [VirtualServiceRef]
listVirtualServicesResponse_virtualServices :: Lens' ListVirtualServicesResponse [VirtualServiceRef]
listVirtualServicesResponse_virtualServices = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualServicesResponse' {[VirtualServiceRef]
virtualServices :: [VirtualServiceRef]
$sel:virtualServices:ListVirtualServicesResponse' :: ListVirtualServicesResponse -> [VirtualServiceRef]
virtualServices} -> [VirtualServiceRef]
virtualServices) (\s :: ListVirtualServicesResponse
s@ListVirtualServicesResponse' {} [VirtualServiceRef]
a -> ListVirtualServicesResponse
s {$sel:virtualServices:ListVirtualServicesResponse' :: [VirtualServiceRef]
virtualServices = [VirtualServiceRef]
a} :: ListVirtualServicesResponse) 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 ListVirtualServicesResponse where
  rnf :: ListVirtualServicesResponse -> ()
rnf ListVirtualServicesResponse' {Int
[VirtualServiceRef]
Maybe Text
virtualServices :: [VirtualServiceRef]
httpStatus :: Int
nextToken :: Maybe Text
$sel:virtualServices:ListVirtualServicesResponse' :: ListVirtualServicesResponse -> [VirtualServiceRef]
$sel:httpStatus:ListVirtualServicesResponse' :: ListVirtualServicesResponse -> Int
$sel:nextToken:ListVirtualServicesResponse' :: ListVirtualServicesResponse -> 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 [VirtualServiceRef]
virtualServices