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