{-# 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.DescribeMesh
(
DescribeMesh (..),
newDescribeMesh,
describeMesh_meshOwner,
describeMesh_meshName,
DescribeMeshResponse (..),
newDescribeMeshResponse,
describeMeshResponse_httpStatus,
describeMeshResponse_mesh,
)
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 DescribeMesh = DescribeMesh'
{
DescribeMesh -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
DescribeMesh -> Text
meshName :: Prelude.Text
}
deriving (DescribeMesh -> DescribeMesh -> Bool
(DescribeMesh -> DescribeMesh -> Bool)
-> (DescribeMesh -> DescribeMesh -> Bool) -> Eq DescribeMesh
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeMesh -> DescribeMesh -> Bool
$c/= :: DescribeMesh -> DescribeMesh -> Bool
== :: DescribeMesh -> DescribeMesh -> Bool
$c== :: DescribeMesh -> DescribeMesh -> Bool
Prelude.Eq, ReadPrec [DescribeMesh]
ReadPrec DescribeMesh
Int -> ReadS DescribeMesh
ReadS [DescribeMesh]
(Int -> ReadS DescribeMesh)
-> ReadS [DescribeMesh]
-> ReadPrec DescribeMesh
-> ReadPrec [DescribeMesh]
-> Read DescribeMesh
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeMesh]
$creadListPrec :: ReadPrec [DescribeMesh]
readPrec :: ReadPrec DescribeMesh
$creadPrec :: ReadPrec DescribeMesh
readList :: ReadS [DescribeMesh]
$creadList :: ReadS [DescribeMesh]
readsPrec :: Int -> ReadS DescribeMesh
$creadsPrec :: Int -> ReadS DescribeMesh
Prelude.Read, Int -> DescribeMesh -> ShowS
[DescribeMesh] -> ShowS
DescribeMesh -> String
(Int -> DescribeMesh -> ShowS)
-> (DescribeMesh -> String)
-> ([DescribeMesh] -> ShowS)
-> Show DescribeMesh
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeMesh] -> ShowS
$cshowList :: [DescribeMesh] -> ShowS
show :: DescribeMesh -> String
$cshow :: DescribeMesh -> String
showsPrec :: Int -> DescribeMesh -> ShowS
$cshowsPrec :: Int -> DescribeMesh -> ShowS
Prelude.Show, (forall x. DescribeMesh -> Rep DescribeMesh x)
-> (forall x. Rep DescribeMesh x -> DescribeMesh)
-> Generic DescribeMesh
forall x. Rep DescribeMesh x -> DescribeMesh
forall x. DescribeMesh -> Rep DescribeMesh x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeMesh x -> DescribeMesh
$cfrom :: forall x. DescribeMesh -> Rep DescribeMesh x
Prelude.Generic)
newDescribeMesh ::
Prelude.Text ->
DescribeMesh
newDescribeMesh :: Text -> DescribeMesh
newDescribeMesh Text
pMeshName_ =
DescribeMesh' :: Maybe Text -> Text -> DescribeMesh
DescribeMesh'
{ $sel:meshOwner:DescribeMesh' :: Maybe Text
meshOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:meshName:DescribeMesh' :: Text
meshName = Text
pMeshName_
}
describeMesh_meshOwner :: Lens.Lens' DescribeMesh (Prelude.Maybe Prelude.Text)
describeMesh_meshOwner :: (Maybe Text -> f (Maybe Text)) -> DescribeMesh -> f DescribeMesh
describeMesh_meshOwner = (DescribeMesh -> Maybe Text)
-> (DescribeMesh -> Maybe Text -> DescribeMesh)
-> Lens DescribeMesh DescribeMesh (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMesh' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:DescribeMesh' :: DescribeMesh -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: DescribeMesh
s@DescribeMesh' {} Maybe Text
a -> DescribeMesh
s {$sel:meshOwner:DescribeMesh' :: Maybe Text
meshOwner = Maybe Text
a} :: DescribeMesh)
describeMesh_meshName :: Lens.Lens' DescribeMesh Prelude.Text
describeMesh_meshName :: (Text -> f Text) -> DescribeMesh -> f DescribeMesh
describeMesh_meshName = (DescribeMesh -> Text)
-> (DescribeMesh -> Text -> DescribeMesh)
-> Lens DescribeMesh DescribeMesh Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMesh' {Text
meshName :: Text
$sel:meshName:DescribeMesh' :: DescribeMesh -> Text
meshName} -> Text
meshName) (\s :: DescribeMesh
s@DescribeMesh' {} Text
a -> DescribeMesh
s {$sel:meshName:DescribeMesh' :: Text
meshName = Text
a} :: DescribeMesh)
instance Core.AWSRequest DescribeMesh where
type AWSResponse DescribeMesh = DescribeMeshResponse
request :: DescribeMesh -> Request DescribeMesh
request = Service -> DescribeMesh -> Request DescribeMesh
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeMesh
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeMesh)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeMesh))
-> Logger
-> Service
-> Proxy DescribeMesh
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeMesh)))
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 -> MeshData -> DescribeMeshResponse
DescribeMeshResponse'
(Int -> MeshData -> DescribeMeshResponse)
-> Either String Int
-> Either String (MeshData -> DescribeMeshResponse)
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 (MeshData -> DescribeMeshResponse)
-> Either String MeshData -> Either String DescribeMeshResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String MeshData
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable DescribeMesh
instance Prelude.NFData DescribeMesh
instance Core.ToHeaders DescribeMesh where
toHeaders :: DescribeMesh -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeMesh -> 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 DescribeMesh where
toPath :: DescribeMesh -> ByteString
toPath DescribeMesh' {Maybe Text
Text
meshName :: Text
meshOwner :: Maybe Text
$sel:meshName:DescribeMesh' :: DescribeMesh -> Text
$sel:meshOwner:DescribeMesh' :: DescribeMesh -> 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]
instance Core.ToQuery DescribeMesh where
toQuery :: DescribeMesh -> QueryString
toQuery DescribeMesh' {Maybe Text
Text
meshName :: Text
meshOwner :: Maybe Text
$sel:meshName:DescribeMesh' :: DescribeMesh -> Text
$sel:meshOwner:DescribeMesh' :: DescribeMesh -> 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 DescribeMeshResponse = DescribeMeshResponse'
{
DescribeMeshResponse -> Int
httpStatus :: Prelude.Int,
DescribeMeshResponse -> MeshData
mesh :: MeshData
}
deriving (DescribeMeshResponse -> DescribeMeshResponse -> Bool
(DescribeMeshResponse -> DescribeMeshResponse -> Bool)
-> (DescribeMeshResponse -> DescribeMeshResponse -> Bool)
-> Eq DescribeMeshResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeMeshResponse -> DescribeMeshResponse -> Bool
$c/= :: DescribeMeshResponse -> DescribeMeshResponse -> Bool
== :: DescribeMeshResponse -> DescribeMeshResponse -> Bool
$c== :: DescribeMeshResponse -> DescribeMeshResponse -> Bool
Prelude.Eq, ReadPrec [DescribeMeshResponse]
ReadPrec DescribeMeshResponse
Int -> ReadS DescribeMeshResponse
ReadS [DescribeMeshResponse]
(Int -> ReadS DescribeMeshResponse)
-> ReadS [DescribeMeshResponse]
-> ReadPrec DescribeMeshResponse
-> ReadPrec [DescribeMeshResponse]
-> Read DescribeMeshResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeMeshResponse]
$creadListPrec :: ReadPrec [DescribeMeshResponse]
readPrec :: ReadPrec DescribeMeshResponse
$creadPrec :: ReadPrec DescribeMeshResponse
readList :: ReadS [DescribeMeshResponse]
$creadList :: ReadS [DescribeMeshResponse]
readsPrec :: Int -> ReadS DescribeMeshResponse
$creadsPrec :: Int -> ReadS DescribeMeshResponse
Prelude.Read, Int -> DescribeMeshResponse -> ShowS
[DescribeMeshResponse] -> ShowS
DescribeMeshResponse -> String
(Int -> DescribeMeshResponse -> ShowS)
-> (DescribeMeshResponse -> String)
-> ([DescribeMeshResponse] -> ShowS)
-> Show DescribeMeshResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeMeshResponse] -> ShowS
$cshowList :: [DescribeMeshResponse] -> ShowS
show :: DescribeMeshResponse -> String
$cshow :: DescribeMeshResponse -> String
showsPrec :: Int -> DescribeMeshResponse -> ShowS
$cshowsPrec :: Int -> DescribeMeshResponse -> ShowS
Prelude.Show, (forall x. DescribeMeshResponse -> Rep DescribeMeshResponse x)
-> (forall x. Rep DescribeMeshResponse x -> DescribeMeshResponse)
-> Generic DescribeMeshResponse
forall x. Rep DescribeMeshResponse x -> DescribeMeshResponse
forall x. DescribeMeshResponse -> Rep DescribeMeshResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeMeshResponse x -> DescribeMeshResponse
$cfrom :: forall x. DescribeMeshResponse -> Rep DescribeMeshResponse x
Prelude.Generic)
newDescribeMeshResponse ::
Prelude.Int ->
MeshData ->
DescribeMeshResponse
newDescribeMeshResponse :: Int -> MeshData -> DescribeMeshResponse
newDescribeMeshResponse Int
pHttpStatus_ MeshData
pMesh_ =
DescribeMeshResponse' :: Int -> MeshData -> DescribeMeshResponse
DescribeMeshResponse'
{ $sel:httpStatus:DescribeMeshResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:mesh:DescribeMeshResponse' :: MeshData
mesh = MeshData
pMesh_
}
describeMeshResponse_httpStatus :: Lens.Lens' DescribeMeshResponse Prelude.Int
describeMeshResponse_httpStatus :: (Int -> f Int) -> DescribeMeshResponse -> f DescribeMeshResponse
describeMeshResponse_httpStatus = (DescribeMeshResponse -> Int)
-> (DescribeMeshResponse -> Int -> DescribeMeshResponse)
-> Lens DescribeMeshResponse DescribeMeshResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMeshResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeMeshResponse' :: DescribeMeshResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeMeshResponse
s@DescribeMeshResponse' {} Int
a -> DescribeMeshResponse
s {$sel:httpStatus:DescribeMeshResponse' :: Int
httpStatus = Int
a} :: DescribeMeshResponse)
describeMeshResponse_mesh :: Lens.Lens' DescribeMeshResponse MeshData
describeMeshResponse_mesh :: (MeshData -> f MeshData)
-> DescribeMeshResponse -> f DescribeMeshResponse
describeMeshResponse_mesh = (DescribeMeshResponse -> MeshData)
-> (DescribeMeshResponse -> MeshData -> DescribeMeshResponse)
-> Lens DescribeMeshResponse DescribeMeshResponse MeshData MeshData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMeshResponse' {MeshData
mesh :: MeshData
$sel:mesh:DescribeMeshResponse' :: DescribeMeshResponse -> MeshData
mesh} -> MeshData
mesh) (\s :: DescribeMeshResponse
s@DescribeMeshResponse' {} MeshData
a -> DescribeMeshResponse
s {$sel:mesh:DescribeMeshResponse' :: MeshData
mesh = MeshData
a} :: DescribeMeshResponse)
instance Prelude.NFData DescribeMeshResponse