{-# 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.DeleteMesh
(
DeleteMesh (..),
newDeleteMesh,
deleteMesh_meshName,
DeleteMeshResponse (..),
newDeleteMeshResponse,
deleteMeshResponse_httpStatus,
deleteMeshResponse_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 DeleteMesh = DeleteMesh'
{
DeleteMesh -> Text
meshName :: Prelude.Text
}
deriving (DeleteMesh -> DeleteMesh -> Bool
(DeleteMesh -> DeleteMesh -> Bool)
-> (DeleteMesh -> DeleteMesh -> Bool) -> Eq DeleteMesh
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMesh -> DeleteMesh -> Bool
$c/= :: DeleteMesh -> DeleteMesh -> Bool
== :: DeleteMesh -> DeleteMesh -> Bool
$c== :: DeleteMesh -> DeleteMesh -> Bool
Prelude.Eq, ReadPrec [DeleteMesh]
ReadPrec DeleteMesh
Int -> ReadS DeleteMesh
ReadS [DeleteMesh]
(Int -> ReadS DeleteMesh)
-> ReadS [DeleteMesh]
-> ReadPrec DeleteMesh
-> ReadPrec [DeleteMesh]
-> Read DeleteMesh
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMesh]
$creadListPrec :: ReadPrec [DeleteMesh]
readPrec :: ReadPrec DeleteMesh
$creadPrec :: ReadPrec DeleteMesh
readList :: ReadS [DeleteMesh]
$creadList :: ReadS [DeleteMesh]
readsPrec :: Int -> ReadS DeleteMesh
$creadsPrec :: Int -> ReadS DeleteMesh
Prelude.Read, Int -> DeleteMesh -> ShowS
[DeleteMesh] -> ShowS
DeleteMesh -> String
(Int -> DeleteMesh -> ShowS)
-> (DeleteMesh -> String)
-> ([DeleteMesh] -> ShowS)
-> Show DeleteMesh
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMesh] -> ShowS
$cshowList :: [DeleteMesh] -> ShowS
show :: DeleteMesh -> String
$cshow :: DeleteMesh -> String
showsPrec :: Int -> DeleteMesh -> ShowS
$cshowsPrec :: Int -> DeleteMesh -> ShowS
Prelude.Show, (forall x. DeleteMesh -> Rep DeleteMesh x)
-> (forall x. Rep DeleteMesh x -> DeleteMesh) -> Generic DeleteMesh
forall x. Rep DeleteMesh x -> DeleteMesh
forall x. DeleteMesh -> Rep DeleteMesh x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteMesh x -> DeleteMesh
$cfrom :: forall x. DeleteMesh -> Rep DeleteMesh x
Prelude.Generic)
newDeleteMesh ::
Prelude.Text ->
DeleteMesh
newDeleteMesh :: Text -> DeleteMesh
newDeleteMesh Text
pMeshName_ =
DeleteMesh' :: Text -> DeleteMesh
DeleteMesh' {$sel:meshName:DeleteMesh' :: Text
meshName = Text
pMeshName_}
deleteMesh_meshName :: Lens.Lens' DeleteMesh Prelude.Text
deleteMesh_meshName :: (Text -> f Text) -> DeleteMesh -> f DeleteMesh
deleteMesh_meshName = (DeleteMesh -> Text)
-> (DeleteMesh -> Text -> DeleteMesh)
-> Lens DeleteMesh DeleteMesh Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMesh' {Text
meshName :: Text
$sel:meshName:DeleteMesh' :: DeleteMesh -> Text
meshName} -> Text
meshName) (\s :: DeleteMesh
s@DeleteMesh' {} Text
a -> DeleteMesh
s {$sel:meshName:DeleteMesh' :: Text
meshName = Text
a} :: DeleteMesh)
instance Core.AWSRequest DeleteMesh where
type AWSResponse DeleteMesh = DeleteMeshResponse
request :: DeleteMesh -> Request DeleteMesh
request = Service -> DeleteMesh -> Request DeleteMesh
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteMesh
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteMesh)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteMesh))
-> Logger
-> Service
-> Proxy DeleteMesh
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteMesh)))
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 -> DeleteMeshResponse
DeleteMeshResponse'
(Int -> MeshData -> DeleteMeshResponse)
-> Either String Int
-> Either String (MeshData -> DeleteMeshResponse)
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 -> DeleteMeshResponse)
-> Either String MeshData -> Either String DeleteMeshResponse
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 DeleteMesh
instance Prelude.NFData DeleteMesh
instance Core.ToHeaders DeleteMesh where
toHeaders :: DeleteMesh -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteMesh -> 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 DeleteMesh where
toPath :: DeleteMesh -> ByteString
toPath DeleteMesh' {Text
meshName :: Text
$sel:meshName:DeleteMesh' :: DeleteMesh -> 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 DeleteMesh where
toQuery :: DeleteMesh -> QueryString
toQuery = QueryString -> DeleteMesh -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteMeshResponse = DeleteMeshResponse'
{
DeleteMeshResponse -> Int
httpStatus :: Prelude.Int,
DeleteMeshResponse -> MeshData
mesh :: MeshData
}
deriving (DeleteMeshResponse -> DeleteMeshResponse -> Bool
(DeleteMeshResponse -> DeleteMeshResponse -> Bool)
-> (DeleteMeshResponse -> DeleteMeshResponse -> Bool)
-> Eq DeleteMeshResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMeshResponse -> DeleteMeshResponse -> Bool
$c/= :: DeleteMeshResponse -> DeleteMeshResponse -> Bool
== :: DeleteMeshResponse -> DeleteMeshResponse -> Bool
$c== :: DeleteMeshResponse -> DeleteMeshResponse -> Bool
Prelude.Eq, ReadPrec [DeleteMeshResponse]
ReadPrec DeleteMeshResponse
Int -> ReadS DeleteMeshResponse
ReadS [DeleteMeshResponse]
(Int -> ReadS DeleteMeshResponse)
-> ReadS [DeleteMeshResponse]
-> ReadPrec DeleteMeshResponse
-> ReadPrec [DeleteMeshResponse]
-> Read DeleteMeshResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMeshResponse]
$creadListPrec :: ReadPrec [DeleteMeshResponse]
readPrec :: ReadPrec DeleteMeshResponse
$creadPrec :: ReadPrec DeleteMeshResponse
readList :: ReadS [DeleteMeshResponse]
$creadList :: ReadS [DeleteMeshResponse]
readsPrec :: Int -> ReadS DeleteMeshResponse
$creadsPrec :: Int -> ReadS DeleteMeshResponse
Prelude.Read, Int -> DeleteMeshResponse -> ShowS
[DeleteMeshResponse] -> ShowS
DeleteMeshResponse -> String
(Int -> DeleteMeshResponse -> ShowS)
-> (DeleteMeshResponse -> String)
-> ([DeleteMeshResponse] -> ShowS)
-> Show DeleteMeshResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMeshResponse] -> ShowS
$cshowList :: [DeleteMeshResponse] -> ShowS
show :: DeleteMeshResponse -> String
$cshow :: DeleteMeshResponse -> String
showsPrec :: Int -> DeleteMeshResponse -> ShowS
$cshowsPrec :: Int -> DeleteMeshResponse -> ShowS
Prelude.Show, (forall x. DeleteMeshResponse -> Rep DeleteMeshResponse x)
-> (forall x. Rep DeleteMeshResponse x -> DeleteMeshResponse)
-> Generic DeleteMeshResponse
forall x. Rep DeleteMeshResponse x -> DeleteMeshResponse
forall x. DeleteMeshResponse -> Rep DeleteMeshResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteMeshResponse x -> DeleteMeshResponse
$cfrom :: forall x. DeleteMeshResponse -> Rep DeleteMeshResponse x
Prelude.Generic)
newDeleteMeshResponse ::
Prelude.Int ->
MeshData ->
DeleteMeshResponse
newDeleteMeshResponse :: Int -> MeshData -> DeleteMeshResponse
newDeleteMeshResponse Int
pHttpStatus_ MeshData
pMesh_ =
DeleteMeshResponse' :: Int -> MeshData -> DeleteMeshResponse
DeleteMeshResponse'
{ $sel:httpStatus:DeleteMeshResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:mesh:DeleteMeshResponse' :: MeshData
mesh = MeshData
pMesh_
}
deleteMeshResponse_httpStatus :: Lens.Lens' DeleteMeshResponse Prelude.Int
deleteMeshResponse_httpStatus :: (Int -> f Int) -> DeleteMeshResponse -> f DeleteMeshResponse
deleteMeshResponse_httpStatus = (DeleteMeshResponse -> Int)
-> (DeleteMeshResponse -> Int -> DeleteMeshResponse)
-> Lens DeleteMeshResponse DeleteMeshResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMeshResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteMeshResponse' :: DeleteMeshResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteMeshResponse
s@DeleteMeshResponse' {} Int
a -> DeleteMeshResponse
s {$sel:httpStatus:DeleteMeshResponse' :: Int
httpStatus = Int
a} :: DeleteMeshResponse)
deleteMeshResponse_mesh :: Lens.Lens' DeleteMeshResponse MeshData
deleteMeshResponse_mesh :: (MeshData -> f MeshData)
-> DeleteMeshResponse -> f DeleteMeshResponse
deleteMeshResponse_mesh = (DeleteMeshResponse -> MeshData)
-> (DeleteMeshResponse -> MeshData -> DeleteMeshResponse)
-> Lens DeleteMeshResponse DeleteMeshResponse MeshData MeshData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMeshResponse' {MeshData
mesh :: MeshData
$sel:mesh:DeleteMeshResponse' :: DeleteMeshResponse -> MeshData
mesh} -> MeshData
mesh) (\s :: DeleteMeshResponse
s@DeleteMeshResponse' {} MeshData
a -> DeleteMeshResponse
s {$sel:mesh:DeleteMeshResponse' :: MeshData
mesh = MeshData
a} :: DeleteMeshResponse)
instance Prelude.NFData DeleteMeshResponse