{-# 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.ListVirtualRouters
(
ListVirtualRouters (..),
newListVirtualRouters,
listVirtualRouters_limit,
listVirtualRouters_meshOwner,
listVirtualRouters_nextToken,
listVirtualRouters_meshName,
ListVirtualRoutersResponse (..),
newListVirtualRoutersResponse,
listVirtualRoutersResponse_nextToken,
listVirtualRoutersResponse_httpStatus,
listVirtualRoutersResponse_virtualRouters,
)
where
import Amazonka.AppMesh.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListVirtualRouters = ListVirtualRouters'
{
ListVirtualRouters -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListVirtualRouters -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
ListVirtualRouters -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListVirtualRouters -> Text
meshName :: Prelude.Text
}
deriving (ListVirtualRouters -> ListVirtualRouters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVirtualRouters -> ListVirtualRouters -> Bool
$c/= :: ListVirtualRouters -> ListVirtualRouters -> Bool
== :: ListVirtualRouters -> ListVirtualRouters -> Bool
$c== :: ListVirtualRouters -> ListVirtualRouters -> Bool
Prelude.Eq, ReadPrec [ListVirtualRouters]
ReadPrec ListVirtualRouters
Int -> ReadS ListVirtualRouters
ReadS [ListVirtualRouters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVirtualRouters]
$creadListPrec :: ReadPrec [ListVirtualRouters]
readPrec :: ReadPrec ListVirtualRouters
$creadPrec :: ReadPrec ListVirtualRouters
readList :: ReadS [ListVirtualRouters]
$creadList :: ReadS [ListVirtualRouters]
readsPrec :: Int -> ReadS ListVirtualRouters
$creadsPrec :: Int -> ReadS ListVirtualRouters
Prelude.Read, Int -> ListVirtualRouters -> ShowS
[ListVirtualRouters] -> ShowS
ListVirtualRouters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVirtualRouters] -> ShowS
$cshowList :: [ListVirtualRouters] -> ShowS
show :: ListVirtualRouters -> String
$cshow :: ListVirtualRouters -> String
showsPrec :: Int -> ListVirtualRouters -> ShowS
$cshowsPrec :: Int -> ListVirtualRouters -> ShowS
Prelude.Show, forall x. Rep ListVirtualRouters x -> ListVirtualRouters
forall x. ListVirtualRouters -> Rep ListVirtualRouters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVirtualRouters x -> ListVirtualRouters
$cfrom :: forall x. ListVirtualRouters -> Rep ListVirtualRouters x
Prelude.Generic)
newListVirtualRouters ::
Prelude.Text ->
ListVirtualRouters
newListVirtualRouters :: Text -> ListVirtualRouters
newListVirtualRouters Text
pMeshName_ =
ListVirtualRouters'
{ $sel:limit:ListVirtualRouters' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
$sel:meshOwner:ListVirtualRouters' :: Maybe Text
meshOwner = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListVirtualRouters' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:meshName:ListVirtualRouters' :: Text
meshName = Text
pMeshName_
}
listVirtualRouters_limit :: Lens.Lens' ListVirtualRouters (Prelude.Maybe Prelude.Natural)
listVirtualRouters_limit :: Lens' ListVirtualRouters (Maybe Natural)
listVirtualRouters_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRouters' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListVirtualRouters' :: ListVirtualRouters -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListVirtualRouters
s@ListVirtualRouters' {} Maybe Natural
a -> ListVirtualRouters
s {$sel:limit:ListVirtualRouters' :: Maybe Natural
limit = Maybe Natural
a} :: ListVirtualRouters)
listVirtualRouters_meshOwner :: Lens.Lens' ListVirtualRouters (Prelude.Maybe Prelude.Text)
listVirtualRouters_meshOwner :: Lens' ListVirtualRouters (Maybe Text)
listVirtualRouters_meshOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRouters' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: ListVirtualRouters
s@ListVirtualRouters' {} Maybe Text
a -> ListVirtualRouters
s {$sel:meshOwner:ListVirtualRouters' :: Maybe Text
meshOwner = Maybe Text
a} :: ListVirtualRouters)
listVirtualRouters_nextToken :: Lens.Lens' ListVirtualRouters (Prelude.Maybe Prelude.Text)
listVirtualRouters_nextToken :: Lens' ListVirtualRouters (Maybe Text)
listVirtualRouters_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRouters' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVirtualRouters
s@ListVirtualRouters' {} Maybe Text
a -> ListVirtualRouters
s {$sel:nextToken:ListVirtualRouters' :: Maybe Text
nextToken = Maybe Text
a} :: ListVirtualRouters)
listVirtualRouters_meshName :: Lens.Lens' ListVirtualRouters Prelude.Text
listVirtualRouters_meshName :: Lens' ListVirtualRouters Text
listVirtualRouters_meshName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRouters' {Text
meshName :: Text
$sel:meshName:ListVirtualRouters' :: ListVirtualRouters -> Text
meshName} -> Text
meshName) (\s :: ListVirtualRouters
s@ListVirtualRouters' {} Text
a -> ListVirtualRouters
s {$sel:meshName:ListVirtualRouters' :: Text
meshName = Text
a} :: ListVirtualRouters)
instance Core.AWSPager ListVirtualRouters where
page :: ListVirtualRouters
-> AWSResponse ListVirtualRouters -> Maybe ListVirtualRouters
page ListVirtualRouters
rq AWSResponse ListVirtualRouters
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListVirtualRouters
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVirtualRoutersResponse (Maybe Text)
listVirtualRoutersResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListVirtualRouters
rs
forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListVirtualRoutersResponse [VirtualRouterRef]
listVirtualRoutersResponse_virtualRouters
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListVirtualRouters
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListVirtualRouters (Maybe Text)
listVirtualRouters_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVirtualRouters
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVirtualRoutersResponse (Maybe Text)
listVirtualRoutersResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListVirtualRouters where
type
AWSResponse ListVirtualRouters =
ListVirtualRoutersResponse
request :: (Service -> Service)
-> ListVirtualRouters -> Request ListVirtualRouters
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListVirtualRouters
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListVirtualRouters)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Int -> [VirtualRouterRef] -> ListVirtualRoutersResponse
ListVirtualRoutersResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"virtualRouters"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ListVirtualRouters where
hashWithSalt :: Int -> ListVirtualRouters -> Int
hashWithSalt Int
_salt ListVirtualRouters' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualRouters' :: ListVirtualRouters -> Text
$sel:nextToken:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:meshOwner:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:limit:ListVirtualRouters' :: ListVirtualRouters -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
meshOwner
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
meshName
instance Prelude.NFData ListVirtualRouters where
rnf :: ListVirtualRouters -> ()
rnf ListVirtualRouters' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualRouters' :: ListVirtualRouters -> Text
$sel:nextToken:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:meshOwner:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:limit:ListVirtualRouters' :: ListVirtualRouters -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
meshOwner
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
meshName
instance Data.ToHeaders ListVirtualRouters where
toHeaders :: ListVirtualRouters -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListVirtualRouters where
toPath :: ListVirtualRouters -> ByteString
toPath ListVirtualRouters' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualRouters' :: ListVirtualRouters -> Text
$sel:nextToken:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:meshOwner:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:limit:ListVirtualRouters' :: ListVirtualRouters -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v20190125/meshes/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
meshName,
ByteString
"/virtualRouters"
]
instance Data.ToQuery ListVirtualRouters where
toQuery :: ListVirtualRouters -> QueryString
toQuery ListVirtualRouters' {Maybe Natural
Maybe Text
Text
meshName :: Text
nextToken :: Maybe Text
meshOwner :: Maybe Text
limit :: Maybe Natural
$sel:meshName:ListVirtualRouters' :: ListVirtualRouters -> Text
$sel:nextToken:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:meshOwner:ListVirtualRouters' :: ListVirtualRouters -> Maybe Text
$sel:limit:ListVirtualRouters' :: ListVirtualRouters -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"limit" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
limit,
ByteString
"meshOwner" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
meshOwner,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListVirtualRoutersResponse = ListVirtualRoutersResponse'
{
ListVirtualRoutersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListVirtualRoutersResponse -> Int
httpStatus :: Prelude.Int,
ListVirtualRoutersResponse -> [VirtualRouterRef]
virtualRouters :: [VirtualRouterRef]
}
deriving (ListVirtualRoutersResponse -> ListVirtualRoutersResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVirtualRoutersResponse -> ListVirtualRoutersResponse -> Bool
$c/= :: ListVirtualRoutersResponse -> ListVirtualRoutersResponse -> Bool
== :: ListVirtualRoutersResponse -> ListVirtualRoutersResponse -> Bool
$c== :: ListVirtualRoutersResponse -> ListVirtualRoutersResponse -> Bool
Prelude.Eq, ReadPrec [ListVirtualRoutersResponse]
ReadPrec ListVirtualRoutersResponse
Int -> ReadS ListVirtualRoutersResponse
ReadS [ListVirtualRoutersResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVirtualRoutersResponse]
$creadListPrec :: ReadPrec [ListVirtualRoutersResponse]
readPrec :: ReadPrec ListVirtualRoutersResponse
$creadPrec :: ReadPrec ListVirtualRoutersResponse
readList :: ReadS [ListVirtualRoutersResponse]
$creadList :: ReadS [ListVirtualRoutersResponse]
readsPrec :: Int -> ReadS ListVirtualRoutersResponse
$creadsPrec :: Int -> ReadS ListVirtualRoutersResponse
Prelude.Read, Int -> ListVirtualRoutersResponse -> ShowS
[ListVirtualRoutersResponse] -> ShowS
ListVirtualRoutersResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVirtualRoutersResponse] -> ShowS
$cshowList :: [ListVirtualRoutersResponse] -> ShowS
show :: ListVirtualRoutersResponse -> String
$cshow :: ListVirtualRoutersResponse -> String
showsPrec :: Int -> ListVirtualRoutersResponse -> ShowS
$cshowsPrec :: Int -> ListVirtualRoutersResponse -> ShowS
Prelude.Show, forall x.
Rep ListVirtualRoutersResponse x -> ListVirtualRoutersResponse
forall x.
ListVirtualRoutersResponse -> Rep ListVirtualRoutersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVirtualRoutersResponse x -> ListVirtualRoutersResponse
$cfrom :: forall x.
ListVirtualRoutersResponse -> Rep ListVirtualRoutersResponse x
Prelude.Generic)
newListVirtualRoutersResponse ::
Prelude.Int ->
ListVirtualRoutersResponse
newListVirtualRoutersResponse :: Int -> ListVirtualRoutersResponse
newListVirtualRoutersResponse Int
pHttpStatus_ =
ListVirtualRoutersResponse'
{ $sel:nextToken:ListVirtualRoutersResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListVirtualRoutersResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:virtualRouters:ListVirtualRoutersResponse' :: [VirtualRouterRef]
virtualRouters = forall a. Monoid a => a
Prelude.mempty
}
listVirtualRoutersResponse_nextToken :: Lens.Lens' ListVirtualRoutersResponse (Prelude.Maybe Prelude.Text)
listVirtualRoutersResponse_nextToken :: Lens' ListVirtualRoutersResponse (Maybe Text)
listVirtualRoutersResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRoutersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVirtualRoutersResponse' :: ListVirtualRoutersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVirtualRoutersResponse
s@ListVirtualRoutersResponse' {} Maybe Text
a -> ListVirtualRoutersResponse
s {$sel:nextToken:ListVirtualRoutersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListVirtualRoutersResponse)
listVirtualRoutersResponse_httpStatus :: Lens.Lens' ListVirtualRoutersResponse Prelude.Int
listVirtualRoutersResponse_httpStatus :: Lens' ListVirtualRoutersResponse Int
listVirtualRoutersResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRoutersResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListVirtualRoutersResponse' :: ListVirtualRoutersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListVirtualRoutersResponse
s@ListVirtualRoutersResponse' {} Int
a -> ListVirtualRoutersResponse
s {$sel:httpStatus:ListVirtualRoutersResponse' :: Int
httpStatus = Int
a} :: ListVirtualRoutersResponse)
listVirtualRoutersResponse_virtualRouters :: Lens.Lens' ListVirtualRoutersResponse [VirtualRouterRef]
listVirtualRoutersResponse_virtualRouters :: Lens' ListVirtualRoutersResponse [VirtualRouterRef]
listVirtualRoutersResponse_virtualRouters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualRoutersResponse' {[VirtualRouterRef]
virtualRouters :: [VirtualRouterRef]
$sel:virtualRouters:ListVirtualRoutersResponse' :: ListVirtualRoutersResponse -> [VirtualRouterRef]
virtualRouters} -> [VirtualRouterRef]
virtualRouters) (\s :: ListVirtualRoutersResponse
s@ListVirtualRoutersResponse' {} [VirtualRouterRef]
a -> ListVirtualRoutersResponse
s {$sel:virtualRouters:ListVirtualRoutersResponse' :: [VirtualRouterRef]
virtualRouters = [VirtualRouterRef]
a} :: ListVirtualRoutersResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListVirtualRoutersResponse where
rnf :: ListVirtualRoutersResponse -> ()
rnf ListVirtualRoutersResponse' {Int
[VirtualRouterRef]
Maybe Text
virtualRouters :: [VirtualRouterRef]
httpStatus :: Int
nextToken :: Maybe Text
$sel:virtualRouters:ListVirtualRoutersResponse' :: ListVirtualRoutersResponse -> [VirtualRouterRef]
$sel:httpStatus:ListVirtualRoutersResponse' :: ListVirtualRoutersResponse -> Int
$sel:nextToken:ListVirtualRoutersResponse' :: ListVirtualRoutersResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [VirtualRouterRef]
virtualRouters