{-# 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 #-}
module Amazonka.AppMesh.ListVirtualNodes
(
ListVirtualNodes (..),
newListVirtualNodes,
listVirtualNodes_limit,
listVirtualNodes_meshOwner,
listVirtualNodes_nextToken,
listVirtualNodes_meshName,
ListVirtualNodesResponse (..),
newListVirtualNodesResponse,
listVirtualNodesResponse_nextToken,
listVirtualNodesResponse_httpStatus,
listVirtualNodesResponse_virtualNodes,
)
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
data ListVirtualNodes = ListVirtualNodes'
{
ListVirtualNodes -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListVirtualNodes -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
ListVirtualNodes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListVirtualNodes -> Text
meshName :: Prelude.Text
}
deriving (ListVirtualNodes -> ListVirtualNodes -> Bool
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]
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
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. 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)
newListVirtualNodes ::
Prelude.Text ->
ListVirtualNodes
newListVirtualNodes :: Text -> ListVirtualNodes
newListVirtualNodes Text
pMeshName_ =
ListVirtualNodes'
{ $sel:limit:ListVirtualNodes' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
$sel:meshOwner:ListVirtualNodes' :: Maybe Text
meshOwner = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListVirtualNodes' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:meshName:ListVirtualNodes' :: Text
meshName = Text
pMeshName_
}
listVirtualNodes_limit :: Lens.Lens' ListVirtualNodes (Prelude.Maybe Prelude.Natural)
listVirtualNodes_limit :: Lens' ListVirtualNodes (Maybe Natural)
listVirtualNodes_limit = 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)
listVirtualNodes_meshOwner :: Lens.Lens' ListVirtualNodes (Prelude.Maybe Prelude.Text)
listVirtualNodes_meshOwner :: Lens' ListVirtualNodes (Maybe Text)
listVirtualNodes_meshOwner = 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)
listVirtualNodes_nextToken :: Lens.Lens' ListVirtualNodes (Prelude.Maybe Prelude.Text)
listVirtualNodes_nextToken :: Lens' ListVirtualNodes (Maybe Text)
listVirtualNodes_nextToken = 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)
listVirtualNodes_meshName :: Lens.Lens' ListVirtualNodes Prelude.Text
listVirtualNodes_meshName :: Lens' ListVirtualNodes Text
listVirtualNodes_meshName = 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
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListVirtualNodes
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVirtualNodesResponse (Maybe Text)
listVirtualNodesResponse_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 ListVirtualNodes
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListVirtualNodesResponse [VirtualNodeRef]
listVirtualNodesResponse_virtualNodes) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListVirtualNodes
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListVirtualNodes (Maybe Text)
listVirtualNodes_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVirtualNodes
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVirtualNodesResponse (Maybe Text)
listVirtualNodesResponse_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 ListVirtualNodes where
type
AWSResponse ListVirtualNodes =
ListVirtualNodesResponse
request :: (Service -> Service)
-> ListVirtualNodes -> Request ListVirtualNodes
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 ListVirtualNodes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListVirtualNodes)))
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 -> [VirtualNodeRef] -> ListVirtualNodesResponse
ListVirtualNodesResponse'
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
"virtualNodes" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ListVirtualNodes where
hashWithSalt :: Int -> ListVirtualNodes -> Int
hashWithSalt Int
_salt ListVirtualNodes' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualNodes' :: ListVirtualNodes -> Text
$sel:nextToken:ListVirtualNodes' :: ListVirtualNodes -> Maybe Text
$sel:meshOwner:ListVirtualNodes' :: ListVirtualNodes -> Maybe Text
$sel:limit:ListVirtualNodes' :: ListVirtualNodes -> 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 ListVirtualNodes where
rnf :: ListVirtualNodes -> ()
rnf ListVirtualNodes' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualNodes' :: ListVirtualNodes -> Text
$sel:nextToken:ListVirtualNodes' :: ListVirtualNodes -> Maybe Text
$sel:meshOwner:ListVirtualNodes' :: ListVirtualNodes -> Maybe Text
$sel:limit:ListVirtualNodes' :: ListVirtualNodes -> 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 ListVirtualNodes where
toHeaders :: ListVirtualNodes -> 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 ListVirtualNodes where
toPath :: ListVirtualNodes -> ByteString
toPath ListVirtualNodes' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualNodes' :: ListVirtualNodes -> Text
$sel:nextToken:ListVirtualNodes' :: ListVirtualNodes -> Maybe Text
$sel:meshOwner:ListVirtualNodes' :: ListVirtualNodes -> Maybe Text
$sel:limit:ListVirtualNodes' :: ListVirtualNodes -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v20190125/meshes/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
meshName,
ByteString
"/virtualNodes"
]
instance Data.ToQuery ListVirtualNodes where
toQuery :: ListVirtualNodes -> QueryString
toQuery ListVirtualNodes' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualNodes' :: ListVirtualNodes -> Text
$sel:nextToken:ListVirtualNodes' :: ListVirtualNodes -> Maybe Text
$sel:meshOwner:ListVirtualNodes' :: ListVirtualNodes -> Maybe Text
$sel:limit:ListVirtualNodes' :: ListVirtualNodes -> 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
]
data ListVirtualNodesResponse = ListVirtualNodesResponse'
{
ListVirtualNodesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListVirtualNodesResponse -> Int
httpStatus :: Prelude.Int,
ListVirtualNodesResponse -> [VirtualNodeRef]
virtualNodes :: [VirtualNodeRef]
}
deriving (ListVirtualNodesResponse -> ListVirtualNodesResponse -> Bool
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]
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
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.
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)
newListVirtualNodesResponse ::
Prelude.Int ->
ListVirtualNodesResponse
newListVirtualNodesResponse :: Int -> ListVirtualNodesResponse
newListVirtualNodesResponse Int
pHttpStatus_ =
ListVirtualNodesResponse'
{ $sel:nextToken:ListVirtualNodesResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListVirtualNodesResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:virtualNodes:ListVirtualNodesResponse' :: [VirtualNodeRef]
virtualNodes = forall a. Monoid a => a
Prelude.mempty
}
listVirtualNodesResponse_nextToken :: Lens.Lens' ListVirtualNodesResponse (Prelude.Maybe Prelude.Text)
listVirtualNodesResponse_nextToken :: Lens' ListVirtualNodesResponse (Maybe Text)
listVirtualNodesResponse_nextToken = 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)
listVirtualNodesResponse_httpStatus :: Lens.Lens' ListVirtualNodesResponse Prelude.Int
listVirtualNodesResponse_httpStatus :: Lens' ListVirtualNodesResponse Int
listVirtualNodesResponse_httpStatus = 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)
listVirtualNodesResponse_virtualNodes :: Lens.Lens' ListVirtualNodesResponse [VirtualNodeRef]
listVirtualNodesResponse_virtualNodes :: Lens' ListVirtualNodesResponse [VirtualNodeRef]
listVirtualNodesResponse_virtualNodes = 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) 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 ListVirtualNodesResponse where
rnf :: ListVirtualNodesResponse -> ()
rnf ListVirtualNodesResponse' {Int
[VirtualNodeRef]
Maybe Text
virtualNodes :: [VirtualNodeRef]
httpStatus :: Int
nextToken :: Maybe Text
$sel:virtualNodes:ListVirtualNodesResponse' :: ListVirtualNodesResponse -> [VirtualNodeRef]
$sel:httpStatus:ListVirtualNodesResponse' :: ListVirtualNodesResponse -> Int
$sel:nextToken:ListVirtualNodesResponse' :: ListVirtualNodesResponse -> 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 [VirtualNodeRef]
virtualNodes