{-# 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.DescribeVirtualGateway
(
DescribeVirtualGateway (..),
newDescribeVirtualGateway,
describeVirtualGateway_meshOwner,
describeVirtualGateway_meshName,
describeVirtualGateway_virtualGatewayName,
DescribeVirtualGatewayResponse (..),
newDescribeVirtualGatewayResponse,
describeVirtualGatewayResponse_httpStatus,
describeVirtualGatewayResponse_virtualGateway,
)
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 DescribeVirtualGateway = DescribeVirtualGateway'
{
DescribeVirtualGateway -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
DescribeVirtualGateway -> Text
meshName :: Prelude.Text,
DescribeVirtualGateway -> Text
virtualGatewayName :: Prelude.Text
}
deriving (DescribeVirtualGateway -> DescribeVirtualGateway -> Bool
(DescribeVirtualGateway -> DescribeVirtualGateway -> Bool)
-> (DescribeVirtualGateway -> DescribeVirtualGateway -> Bool)
-> Eq DescribeVirtualGateway
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVirtualGateway -> DescribeVirtualGateway -> Bool
$c/= :: DescribeVirtualGateway -> DescribeVirtualGateway -> Bool
== :: DescribeVirtualGateway -> DescribeVirtualGateway -> Bool
$c== :: DescribeVirtualGateway -> DescribeVirtualGateway -> Bool
Prelude.Eq, ReadPrec [DescribeVirtualGateway]
ReadPrec DescribeVirtualGateway
Int -> ReadS DescribeVirtualGateway
ReadS [DescribeVirtualGateway]
(Int -> ReadS DescribeVirtualGateway)
-> ReadS [DescribeVirtualGateway]
-> ReadPrec DescribeVirtualGateway
-> ReadPrec [DescribeVirtualGateway]
-> Read DescribeVirtualGateway
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVirtualGateway]
$creadListPrec :: ReadPrec [DescribeVirtualGateway]
readPrec :: ReadPrec DescribeVirtualGateway
$creadPrec :: ReadPrec DescribeVirtualGateway
readList :: ReadS [DescribeVirtualGateway]
$creadList :: ReadS [DescribeVirtualGateway]
readsPrec :: Int -> ReadS DescribeVirtualGateway
$creadsPrec :: Int -> ReadS DescribeVirtualGateway
Prelude.Read, Int -> DescribeVirtualGateway -> ShowS
[DescribeVirtualGateway] -> ShowS
DescribeVirtualGateway -> String
(Int -> DescribeVirtualGateway -> ShowS)
-> (DescribeVirtualGateway -> String)
-> ([DescribeVirtualGateway] -> ShowS)
-> Show DescribeVirtualGateway
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVirtualGateway] -> ShowS
$cshowList :: [DescribeVirtualGateway] -> ShowS
show :: DescribeVirtualGateway -> String
$cshow :: DescribeVirtualGateway -> String
showsPrec :: Int -> DescribeVirtualGateway -> ShowS
$cshowsPrec :: Int -> DescribeVirtualGateway -> ShowS
Prelude.Show, (forall x. DescribeVirtualGateway -> Rep DescribeVirtualGateway x)
-> (forall x.
Rep DescribeVirtualGateway x -> DescribeVirtualGateway)
-> Generic DescribeVirtualGateway
forall x. Rep DescribeVirtualGateway x -> DescribeVirtualGateway
forall x. DescribeVirtualGateway -> Rep DescribeVirtualGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeVirtualGateway x -> DescribeVirtualGateway
$cfrom :: forall x. DescribeVirtualGateway -> Rep DescribeVirtualGateway x
Prelude.Generic)
newDescribeVirtualGateway ::
Prelude.Text ->
Prelude.Text ->
DescribeVirtualGateway
newDescribeVirtualGateway :: Text -> Text -> DescribeVirtualGateway
newDescribeVirtualGateway
Text
pMeshName_
Text
pVirtualGatewayName_ =
DescribeVirtualGateway' :: Maybe Text -> Text -> Text -> DescribeVirtualGateway
DescribeVirtualGateway'
{ $sel:meshOwner:DescribeVirtualGateway' :: Maybe Text
meshOwner =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:meshName:DescribeVirtualGateway' :: Text
meshName = Text
pMeshName_,
$sel:virtualGatewayName:DescribeVirtualGateway' :: Text
virtualGatewayName = Text
pVirtualGatewayName_
}
describeVirtualGateway_meshOwner :: Lens.Lens' DescribeVirtualGateway (Prelude.Maybe Prelude.Text)
describeVirtualGateway_meshOwner :: (Maybe Text -> f (Maybe Text))
-> DescribeVirtualGateway -> f DescribeVirtualGateway
describeVirtualGateway_meshOwner = (DescribeVirtualGateway -> Maybe Text)
-> (DescribeVirtualGateway -> Maybe Text -> DescribeVirtualGateway)
-> Lens
DescribeVirtualGateway
DescribeVirtualGateway
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualGateway' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:DescribeVirtualGateway' :: DescribeVirtualGateway -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: DescribeVirtualGateway
s@DescribeVirtualGateway' {} Maybe Text
a -> DescribeVirtualGateway
s {$sel:meshOwner:DescribeVirtualGateway' :: Maybe Text
meshOwner = Maybe Text
a} :: DescribeVirtualGateway)
describeVirtualGateway_meshName :: Lens.Lens' DescribeVirtualGateway Prelude.Text
describeVirtualGateway_meshName :: (Text -> f Text)
-> DescribeVirtualGateway -> f DescribeVirtualGateway
describeVirtualGateway_meshName = (DescribeVirtualGateway -> Text)
-> (DescribeVirtualGateway -> Text -> DescribeVirtualGateway)
-> Lens DescribeVirtualGateway DescribeVirtualGateway Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualGateway' {Text
meshName :: Text
$sel:meshName:DescribeVirtualGateway' :: DescribeVirtualGateway -> Text
meshName} -> Text
meshName) (\s :: DescribeVirtualGateway
s@DescribeVirtualGateway' {} Text
a -> DescribeVirtualGateway
s {$sel:meshName:DescribeVirtualGateway' :: Text
meshName = Text
a} :: DescribeVirtualGateway)
describeVirtualGateway_virtualGatewayName :: Lens.Lens' DescribeVirtualGateway Prelude.Text
describeVirtualGateway_virtualGatewayName :: (Text -> f Text)
-> DescribeVirtualGateway -> f DescribeVirtualGateway
describeVirtualGateway_virtualGatewayName = (DescribeVirtualGateway -> Text)
-> (DescribeVirtualGateway -> Text -> DescribeVirtualGateway)
-> Lens DescribeVirtualGateway DescribeVirtualGateway Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualGateway' {Text
virtualGatewayName :: Text
$sel:virtualGatewayName:DescribeVirtualGateway' :: DescribeVirtualGateway -> Text
virtualGatewayName} -> Text
virtualGatewayName) (\s :: DescribeVirtualGateway
s@DescribeVirtualGateway' {} Text
a -> DescribeVirtualGateway
s {$sel:virtualGatewayName:DescribeVirtualGateway' :: Text
virtualGatewayName = Text
a} :: DescribeVirtualGateway)
instance Core.AWSRequest DescribeVirtualGateway where
type
AWSResponse DescribeVirtualGateway =
DescribeVirtualGatewayResponse
request :: DescribeVirtualGateway -> Request DescribeVirtualGateway
request = Service -> DescribeVirtualGateway -> Request DescribeVirtualGateway
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeVirtualGateway
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeVirtualGateway)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeVirtualGateway))
-> Logger
-> Service
-> Proxy DescribeVirtualGateway
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeVirtualGateway)))
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 -> VirtualGatewayData -> DescribeVirtualGatewayResponse
DescribeVirtualGatewayResponse'
(Int -> VirtualGatewayData -> DescribeVirtualGatewayResponse)
-> Either String Int
-> Either
String (VirtualGatewayData -> DescribeVirtualGatewayResponse)
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 (VirtualGatewayData -> DescribeVirtualGatewayResponse)
-> Either String VirtualGatewayData
-> Either String DescribeVirtualGatewayResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String VirtualGatewayData
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable DescribeVirtualGateway
instance Prelude.NFData DescribeVirtualGateway
instance Core.ToHeaders DescribeVirtualGateway where
toHeaders :: DescribeVirtualGateway -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeVirtualGateway -> 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 DescribeVirtualGateway where
toPath :: DescribeVirtualGateway -> ByteString
toPath DescribeVirtualGateway' {Maybe Text
Text
virtualGatewayName :: Text
meshName :: Text
meshOwner :: Maybe Text
$sel:virtualGatewayName:DescribeVirtualGateway' :: DescribeVirtualGateway -> Text
$sel:meshName:DescribeVirtualGateway' :: DescribeVirtualGateway -> Text
$sel:meshOwner:DescribeVirtualGateway' :: DescribeVirtualGateway -> 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
"/virtualGateways/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
virtualGatewayName
]
instance Core.ToQuery DescribeVirtualGateway where
toQuery :: DescribeVirtualGateway -> QueryString
toQuery DescribeVirtualGateway' {Maybe Text
Text
virtualGatewayName :: Text
meshName :: Text
meshOwner :: Maybe Text
$sel:virtualGatewayName:DescribeVirtualGateway' :: DescribeVirtualGateway -> Text
$sel:meshName:DescribeVirtualGateway' :: DescribeVirtualGateway -> Text
$sel:meshOwner:DescribeVirtualGateway' :: DescribeVirtualGateway -> 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 DescribeVirtualGatewayResponse = DescribeVirtualGatewayResponse'
{
DescribeVirtualGatewayResponse -> Int
httpStatus :: Prelude.Int,
DescribeVirtualGatewayResponse -> VirtualGatewayData
virtualGateway :: VirtualGatewayData
}
deriving (DescribeVirtualGatewayResponse
-> DescribeVirtualGatewayResponse -> Bool
(DescribeVirtualGatewayResponse
-> DescribeVirtualGatewayResponse -> Bool)
-> (DescribeVirtualGatewayResponse
-> DescribeVirtualGatewayResponse -> Bool)
-> Eq DescribeVirtualGatewayResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVirtualGatewayResponse
-> DescribeVirtualGatewayResponse -> Bool
$c/= :: DescribeVirtualGatewayResponse
-> DescribeVirtualGatewayResponse -> Bool
== :: DescribeVirtualGatewayResponse
-> DescribeVirtualGatewayResponse -> Bool
$c== :: DescribeVirtualGatewayResponse
-> DescribeVirtualGatewayResponse -> Bool
Prelude.Eq, ReadPrec [DescribeVirtualGatewayResponse]
ReadPrec DescribeVirtualGatewayResponse
Int -> ReadS DescribeVirtualGatewayResponse
ReadS [DescribeVirtualGatewayResponse]
(Int -> ReadS DescribeVirtualGatewayResponse)
-> ReadS [DescribeVirtualGatewayResponse]
-> ReadPrec DescribeVirtualGatewayResponse
-> ReadPrec [DescribeVirtualGatewayResponse]
-> Read DescribeVirtualGatewayResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVirtualGatewayResponse]
$creadListPrec :: ReadPrec [DescribeVirtualGatewayResponse]
readPrec :: ReadPrec DescribeVirtualGatewayResponse
$creadPrec :: ReadPrec DescribeVirtualGatewayResponse
readList :: ReadS [DescribeVirtualGatewayResponse]
$creadList :: ReadS [DescribeVirtualGatewayResponse]
readsPrec :: Int -> ReadS DescribeVirtualGatewayResponse
$creadsPrec :: Int -> ReadS DescribeVirtualGatewayResponse
Prelude.Read, Int -> DescribeVirtualGatewayResponse -> ShowS
[DescribeVirtualGatewayResponse] -> ShowS
DescribeVirtualGatewayResponse -> String
(Int -> DescribeVirtualGatewayResponse -> ShowS)
-> (DescribeVirtualGatewayResponse -> String)
-> ([DescribeVirtualGatewayResponse] -> ShowS)
-> Show DescribeVirtualGatewayResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVirtualGatewayResponse] -> ShowS
$cshowList :: [DescribeVirtualGatewayResponse] -> ShowS
show :: DescribeVirtualGatewayResponse -> String
$cshow :: DescribeVirtualGatewayResponse -> String
showsPrec :: Int -> DescribeVirtualGatewayResponse -> ShowS
$cshowsPrec :: Int -> DescribeVirtualGatewayResponse -> ShowS
Prelude.Show, (forall x.
DescribeVirtualGatewayResponse
-> Rep DescribeVirtualGatewayResponse x)
-> (forall x.
Rep DescribeVirtualGatewayResponse x
-> DescribeVirtualGatewayResponse)
-> Generic DescribeVirtualGatewayResponse
forall x.
Rep DescribeVirtualGatewayResponse x
-> DescribeVirtualGatewayResponse
forall x.
DescribeVirtualGatewayResponse
-> Rep DescribeVirtualGatewayResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeVirtualGatewayResponse x
-> DescribeVirtualGatewayResponse
$cfrom :: forall x.
DescribeVirtualGatewayResponse
-> Rep DescribeVirtualGatewayResponse x
Prelude.Generic)
newDescribeVirtualGatewayResponse ::
Prelude.Int ->
VirtualGatewayData ->
DescribeVirtualGatewayResponse
newDescribeVirtualGatewayResponse :: Int -> VirtualGatewayData -> DescribeVirtualGatewayResponse
newDescribeVirtualGatewayResponse
Int
pHttpStatus_
VirtualGatewayData
pVirtualGateway_ =
DescribeVirtualGatewayResponse' :: Int -> VirtualGatewayData -> DescribeVirtualGatewayResponse
DescribeVirtualGatewayResponse'
{ $sel:httpStatus:DescribeVirtualGatewayResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:virtualGateway:DescribeVirtualGatewayResponse' :: VirtualGatewayData
virtualGateway = VirtualGatewayData
pVirtualGateway_
}
describeVirtualGatewayResponse_httpStatus :: Lens.Lens' DescribeVirtualGatewayResponse Prelude.Int
describeVirtualGatewayResponse_httpStatus :: (Int -> f Int)
-> DescribeVirtualGatewayResponse
-> f DescribeVirtualGatewayResponse
describeVirtualGatewayResponse_httpStatus = (DescribeVirtualGatewayResponse -> Int)
-> (DescribeVirtualGatewayResponse
-> Int -> DescribeVirtualGatewayResponse)
-> Lens
DescribeVirtualGatewayResponse
DescribeVirtualGatewayResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualGatewayResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeVirtualGatewayResponse' :: DescribeVirtualGatewayResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeVirtualGatewayResponse
s@DescribeVirtualGatewayResponse' {} Int
a -> DescribeVirtualGatewayResponse
s {$sel:httpStatus:DescribeVirtualGatewayResponse' :: Int
httpStatus = Int
a} :: DescribeVirtualGatewayResponse)
describeVirtualGatewayResponse_virtualGateway :: Lens.Lens' DescribeVirtualGatewayResponse VirtualGatewayData
describeVirtualGatewayResponse_virtualGateway :: (VirtualGatewayData -> f VirtualGatewayData)
-> DescribeVirtualGatewayResponse
-> f DescribeVirtualGatewayResponse
describeVirtualGatewayResponse_virtualGateway = (DescribeVirtualGatewayResponse -> VirtualGatewayData)
-> (DescribeVirtualGatewayResponse
-> VirtualGatewayData -> DescribeVirtualGatewayResponse)
-> Lens
DescribeVirtualGatewayResponse
DescribeVirtualGatewayResponse
VirtualGatewayData
VirtualGatewayData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualGatewayResponse' {VirtualGatewayData
virtualGateway :: VirtualGatewayData
$sel:virtualGateway:DescribeVirtualGatewayResponse' :: DescribeVirtualGatewayResponse -> VirtualGatewayData
virtualGateway} -> VirtualGatewayData
virtualGateway) (\s :: DescribeVirtualGatewayResponse
s@DescribeVirtualGatewayResponse' {} VirtualGatewayData
a -> DescribeVirtualGatewayResponse
s {$sel:virtualGateway:DescribeVirtualGatewayResponse' :: VirtualGatewayData
virtualGateway = VirtualGatewayData
a} :: DescribeVirtualGatewayResponse)
instance
Prelude.NFData
DescribeVirtualGatewayResponse