{-# 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.ListVirtualServices
(
ListVirtualServices (..),
newListVirtualServices,
listVirtualServices_limit,
listVirtualServices_meshOwner,
listVirtualServices_nextToken,
listVirtualServices_meshName,
ListVirtualServicesResponse (..),
newListVirtualServicesResponse,
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
data ListVirtualServices = ListVirtualServices'
{
ListVirtualServices -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListVirtualServices -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
ListVirtualServices -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
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)
newListVirtualServices ::
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_
}
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)
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)
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)
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
]
data ListVirtualServicesResponse = ListVirtualServicesResponse'
{
ListVirtualServicesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListVirtualServicesResponse -> Int
httpStatus :: Prelude.Int,
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)
newListVirtualServicesResponse ::
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
}
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)
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)
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