{-# 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.DescribeVirtualRouter
(
DescribeVirtualRouter (..),
newDescribeVirtualRouter,
describeVirtualRouter_meshOwner,
describeVirtualRouter_meshName,
describeVirtualRouter_virtualRouterName,
DescribeVirtualRouterResponse (..),
newDescribeVirtualRouterResponse,
describeVirtualRouterResponse_httpStatus,
describeVirtualRouterResponse_virtualRouter,
)
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
data DescribeVirtualRouter = DescribeVirtualRouter'
{
DescribeVirtualRouter -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
DescribeVirtualRouter -> Text
meshName :: Prelude.Text,
DescribeVirtualRouter -> Text
virtualRouterName :: Prelude.Text
}
deriving (DescribeVirtualRouter -> DescribeVirtualRouter -> Bool
(DescribeVirtualRouter -> DescribeVirtualRouter -> Bool)
-> (DescribeVirtualRouter -> DescribeVirtualRouter -> Bool)
-> Eq DescribeVirtualRouter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVirtualRouter -> DescribeVirtualRouter -> Bool
$c/= :: DescribeVirtualRouter -> DescribeVirtualRouter -> Bool
== :: DescribeVirtualRouter -> DescribeVirtualRouter -> Bool
$c== :: DescribeVirtualRouter -> DescribeVirtualRouter -> Bool
Prelude.Eq, ReadPrec [DescribeVirtualRouter]
ReadPrec DescribeVirtualRouter
Int -> ReadS DescribeVirtualRouter
ReadS [DescribeVirtualRouter]
(Int -> ReadS DescribeVirtualRouter)
-> ReadS [DescribeVirtualRouter]
-> ReadPrec DescribeVirtualRouter
-> ReadPrec [DescribeVirtualRouter]
-> Read DescribeVirtualRouter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVirtualRouter]
$creadListPrec :: ReadPrec [DescribeVirtualRouter]
readPrec :: ReadPrec DescribeVirtualRouter
$creadPrec :: ReadPrec DescribeVirtualRouter
readList :: ReadS [DescribeVirtualRouter]
$creadList :: ReadS [DescribeVirtualRouter]
readsPrec :: Int -> ReadS DescribeVirtualRouter
$creadsPrec :: Int -> ReadS DescribeVirtualRouter
Prelude.Read, Int -> DescribeVirtualRouter -> ShowS
[DescribeVirtualRouter] -> ShowS
DescribeVirtualRouter -> String
(Int -> DescribeVirtualRouter -> ShowS)
-> (DescribeVirtualRouter -> String)
-> ([DescribeVirtualRouter] -> ShowS)
-> Show DescribeVirtualRouter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVirtualRouter] -> ShowS
$cshowList :: [DescribeVirtualRouter] -> ShowS
show :: DescribeVirtualRouter -> String
$cshow :: DescribeVirtualRouter -> String
showsPrec :: Int -> DescribeVirtualRouter -> ShowS
$cshowsPrec :: Int -> DescribeVirtualRouter -> ShowS
Prelude.Show, (forall x. DescribeVirtualRouter -> Rep DescribeVirtualRouter x)
-> (forall x. Rep DescribeVirtualRouter x -> DescribeVirtualRouter)
-> Generic DescribeVirtualRouter
forall x. Rep DescribeVirtualRouter x -> DescribeVirtualRouter
forall x. DescribeVirtualRouter -> Rep DescribeVirtualRouter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeVirtualRouter x -> DescribeVirtualRouter
$cfrom :: forall x. DescribeVirtualRouter -> Rep DescribeVirtualRouter x
Prelude.Generic)
newDescribeVirtualRouter ::
Prelude.Text ->
Prelude.Text ->
DescribeVirtualRouter
newDescribeVirtualRouter :: Text -> Text -> DescribeVirtualRouter
newDescribeVirtualRouter
Text
pMeshName_
Text
pVirtualRouterName_ =
DescribeVirtualRouter' :: Maybe Text -> Text -> Text -> DescribeVirtualRouter
DescribeVirtualRouter'
{ $sel:meshOwner:DescribeVirtualRouter' :: Maybe Text
meshOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:meshName:DescribeVirtualRouter' :: Text
meshName = Text
pMeshName_,
$sel:virtualRouterName:DescribeVirtualRouter' :: Text
virtualRouterName = Text
pVirtualRouterName_
}
describeVirtualRouter_meshOwner :: Lens.Lens' DescribeVirtualRouter (Prelude.Maybe Prelude.Text)
describeVirtualRouter_meshOwner :: (Maybe Text -> f (Maybe Text))
-> DescribeVirtualRouter -> f DescribeVirtualRouter
describeVirtualRouter_meshOwner = (DescribeVirtualRouter -> Maybe Text)
-> (DescribeVirtualRouter -> Maybe Text -> DescribeVirtualRouter)
-> Lens
DescribeVirtualRouter
DescribeVirtualRouter
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualRouter' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:DescribeVirtualRouter' :: DescribeVirtualRouter -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: DescribeVirtualRouter
s@DescribeVirtualRouter' {} Maybe Text
a -> DescribeVirtualRouter
s {$sel:meshOwner:DescribeVirtualRouter' :: Maybe Text
meshOwner = Maybe Text
a} :: DescribeVirtualRouter)
describeVirtualRouter_meshName :: Lens.Lens' DescribeVirtualRouter Prelude.Text
describeVirtualRouter_meshName :: (Text -> f Text)
-> DescribeVirtualRouter -> f DescribeVirtualRouter
describeVirtualRouter_meshName = (DescribeVirtualRouter -> Text)
-> (DescribeVirtualRouter -> Text -> DescribeVirtualRouter)
-> Lens DescribeVirtualRouter DescribeVirtualRouter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualRouter' {Text
meshName :: Text
$sel:meshName:DescribeVirtualRouter' :: DescribeVirtualRouter -> Text
meshName} -> Text
meshName) (\s :: DescribeVirtualRouter
s@DescribeVirtualRouter' {} Text
a -> DescribeVirtualRouter
s {$sel:meshName:DescribeVirtualRouter' :: Text
meshName = Text
a} :: DescribeVirtualRouter)
describeVirtualRouter_virtualRouterName :: Lens.Lens' DescribeVirtualRouter Prelude.Text
describeVirtualRouter_virtualRouterName :: (Text -> f Text)
-> DescribeVirtualRouter -> f DescribeVirtualRouter
describeVirtualRouter_virtualRouterName = (DescribeVirtualRouter -> Text)
-> (DescribeVirtualRouter -> Text -> DescribeVirtualRouter)
-> Lens DescribeVirtualRouter DescribeVirtualRouter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualRouter' {Text
virtualRouterName :: Text
$sel:virtualRouterName:DescribeVirtualRouter' :: DescribeVirtualRouter -> Text
virtualRouterName} -> Text
virtualRouterName) (\s :: DescribeVirtualRouter
s@DescribeVirtualRouter' {} Text
a -> DescribeVirtualRouter
s {$sel:virtualRouterName:DescribeVirtualRouter' :: Text
virtualRouterName = Text
a} :: DescribeVirtualRouter)
instance Core.AWSRequest DescribeVirtualRouter where
type
AWSResponse DescribeVirtualRouter =
DescribeVirtualRouterResponse
request :: DescribeVirtualRouter -> Request DescribeVirtualRouter
request = Service -> DescribeVirtualRouter -> Request DescribeVirtualRouter
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeVirtualRouter
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeVirtualRouter)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeVirtualRouter))
-> Logger
-> Service
-> Proxy DescribeVirtualRouter
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeVirtualRouter)))
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 ->
Int -> VirtualRouterData -> DescribeVirtualRouterResponse
DescribeVirtualRouterResponse'
(Int -> VirtualRouterData -> DescribeVirtualRouterResponse)
-> Either String Int
-> Either
String (VirtualRouterData -> DescribeVirtualRouterResponse)
forall (f :: * -> *) a b. Functor 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 (VirtualRouterData -> DescribeVirtualRouterResponse)
-> Either String VirtualRouterData
-> Either String DescribeVirtualRouterResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String VirtualRouterData
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable DescribeVirtualRouter
instance Prelude.NFData DescribeVirtualRouter
instance Core.ToHeaders DescribeVirtualRouter where
toHeaders :: DescribeVirtualRouter -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeVirtualRouter -> 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 DescribeVirtualRouter where
toPath :: DescribeVirtualRouter -> ByteString
toPath DescribeVirtualRouter' {Maybe Text
Text
virtualRouterName :: Text
meshName :: Text
meshOwner :: Maybe Text
$sel:virtualRouterName:DescribeVirtualRouter' :: DescribeVirtualRouter -> Text
$sel:meshName:DescribeVirtualRouter' :: DescribeVirtualRouter -> Text
$sel:meshOwner:DescribeVirtualRouter' :: DescribeVirtualRouter -> 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
"/virtualRouters/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
virtualRouterName
]
instance Core.ToQuery DescribeVirtualRouter where
toQuery :: DescribeVirtualRouter -> QueryString
toQuery DescribeVirtualRouter' {Maybe Text
Text
virtualRouterName :: Text
meshName :: Text
meshOwner :: Maybe Text
$sel:virtualRouterName:DescribeVirtualRouter' :: DescribeVirtualRouter -> Text
$sel:meshName:DescribeVirtualRouter' :: DescribeVirtualRouter -> Text
$sel:meshOwner:DescribeVirtualRouter' :: DescribeVirtualRouter -> 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]
data DescribeVirtualRouterResponse = DescribeVirtualRouterResponse'
{
DescribeVirtualRouterResponse -> Int
httpStatus :: Prelude.Int,
DescribeVirtualRouterResponse -> VirtualRouterData
virtualRouter :: VirtualRouterData
}
deriving (DescribeVirtualRouterResponse
-> DescribeVirtualRouterResponse -> Bool
(DescribeVirtualRouterResponse
-> DescribeVirtualRouterResponse -> Bool)
-> (DescribeVirtualRouterResponse
-> DescribeVirtualRouterResponse -> Bool)
-> Eq DescribeVirtualRouterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVirtualRouterResponse
-> DescribeVirtualRouterResponse -> Bool
$c/= :: DescribeVirtualRouterResponse
-> DescribeVirtualRouterResponse -> Bool
== :: DescribeVirtualRouterResponse
-> DescribeVirtualRouterResponse -> Bool
$c== :: DescribeVirtualRouterResponse
-> DescribeVirtualRouterResponse -> Bool
Prelude.Eq, ReadPrec [DescribeVirtualRouterResponse]
ReadPrec DescribeVirtualRouterResponse
Int -> ReadS DescribeVirtualRouterResponse
ReadS [DescribeVirtualRouterResponse]
(Int -> ReadS DescribeVirtualRouterResponse)
-> ReadS [DescribeVirtualRouterResponse]
-> ReadPrec DescribeVirtualRouterResponse
-> ReadPrec [DescribeVirtualRouterResponse]
-> Read DescribeVirtualRouterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVirtualRouterResponse]
$creadListPrec :: ReadPrec [DescribeVirtualRouterResponse]
readPrec :: ReadPrec DescribeVirtualRouterResponse
$creadPrec :: ReadPrec DescribeVirtualRouterResponse
readList :: ReadS [DescribeVirtualRouterResponse]
$creadList :: ReadS [DescribeVirtualRouterResponse]
readsPrec :: Int -> ReadS DescribeVirtualRouterResponse
$creadsPrec :: Int -> ReadS DescribeVirtualRouterResponse
Prelude.Read, Int -> DescribeVirtualRouterResponse -> ShowS
[DescribeVirtualRouterResponse] -> ShowS
DescribeVirtualRouterResponse -> String
(Int -> DescribeVirtualRouterResponse -> ShowS)
-> (DescribeVirtualRouterResponse -> String)
-> ([DescribeVirtualRouterResponse] -> ShowS)
-> Show DescribeVirtualRouterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVirtualRouterResponse] -> ShowS
$cshowList :: [DescribeVirtualRouterResponse] -> ShowS
show :: DescribeVirtualRouterResponse -> String
$cshow :: DescribeVirtualRouterResponse -> String
showsPrec :: Int -> DescribeVirtualRouterResponse -> ShowS
$cshowsPrec :: Int -> DescribeVirtualRouterResponse -> ShowS
Prelude.Show, (forall x.
DescribeVirtualRouterResponse
-> Rep DescribeVirtualRouterResponse x)
-> (forall x.
Rep DescribeVirtualRouterResponse x
-> DescribeVirtualRouterResponse)
-> Generic DescribeVirtualRouterResponse
forall x.
Rep DescribeVirtualRouterResponse x
-> DescribeVirtualRouterResponse
forall x.
DescribeVirtualRouterResponse
-> Rep DescribeVirtualRouterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeVirtualRouterResponse x
-> DescribeVirtualRouterResponse
$cfrom :: forall x.
DescribeVirtualRouterResponse
-> Rep DescribeVirtualRouterResponse x
Prelude.Generic)
newDescribeVirtualRouterResponse ::
Prelude.Int ->
VirtualRouterData ->
DescribeVirtualRouterResponse
newDescribeVirtualRouterResponse :: Int -> VirtualRouterData -> DescribeVirtualRouterResponse
newDescribeVirtualRouterResponse
Int
pHttpStatus_
VirtualRouterData
pVirtualRouter_ =
DescribeVirtualRouterResponse' :: Int -> VirtualRouterData -> DescribeVirtualRouterResponse
DescribeVirtualRouterResponse'
{ $sel:httpStatus:DescribeVirtualRouterResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:virtualRouter:DescribeVirtualRouterResponse' :: VirtualRouterData
virtualRouter = VirtualRouterData
pVirtualRouter_
}
describeVirtualRouterResponse_httpStatus :: Lens.Lens' DescribeVirtualRouterResponse Prelude.Int
describeVirtualRouterResponse_httpStatus :: (Int -> f Int)
-> DescribeVirtualRouterResponse -> f DescribeVirtualRouterResponse
describeVirtualRouterResponse_httpStatus = (DescribeVirtualRouterResponse -> Int)
-> (DescribeVirtualRouterResponse
-> Int -> DescribeVirtualRouterResponse)
-> Lens
DescribeVirtualRouterResponse DescribeVirtualRouterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualRouterResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeVirtualRouterResponse' :: DescribeVirtualRouterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeVirtualRouterResponse
s@DescribeVirtualRouterResponse' {} Int
a -> DescribeVirtualRouterResponse
s {$sel:httpStatus:DescribeVirtualRouterResponse' :: Int
httpStatus = Int
a} :: DescribeVirtualRouterResponse)
describeVirtualRouterResponse_virtualRouter :: Lens.Lens' DescribeVirtualRouterResponse VirtualRouterData
describeVirtualRouterResponse_virtualRouter :: (VirtualRouterData -> f VirtualRouterData)
-> DescribeVirtualRouterResponse -> f DescribeVirtualRouterResponse
describeVirtualRouterResponse_virtualRouter = (DescribeVirtualRouterResponse -> VirtualRouterData)
-> (DescribeVirtualRouterResponse
-> VirtualRouterData -> DescribeVirtualRouterResponse)
-> Lens
DescribeVirtualRouterResponse
DescribeVirtualRouterResponse
VirtualRouterData
VirtualRouterData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualRouterResponse' {VirtualRouterData
virtualRouter :: VirtualRouterData
$sel:virtualRouter:DescribeVirtualRouterResponse' :: DescribeVirtualRouterResponse -> VirtualRouterData
virtualRouter} -> VirtualRouterData
virtualRouter) (\s :: DescribeVirtualRouterResponse
s@DescribeVirtualRouterResponse' {} VirtualRouterData
a -> DescribeVirtualRouterResponse
s {$sel:virtualRouter:DescribeVirtualRouterResponse' :: VirtualRouterData
virtualRouter = VirtualRouterData
a} :: DescribeVirtualRouterResponse)
instance Prelude.NFData DescribeVirtualRouterResponse