{-# 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.DeleteVirtualService
(
DeleteVirtualService (..),
newDeleteVirtualService,
deleteVirtualService_meshOwner,
deleteVirtualService_meshName,
deleteVirtualService_virtualServiceName,
DeleteVirtualServiceResponse (..),
newDeleteVirtualServiceResponse,
deleteVirtualServiceResponse_httpStatus,
deleteVirtualServiceResponse_virtualService,
)
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 DeleteVirtualService = DeleteVirtualService'
{
DeleteVirtualService -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
DeleteVirtualService -> Text
meshName :: Prelude.Text,
DeleteVirtualService -> Text
virtualServiceName :: Prelude.Text
}
deriving (DeleteVirtualService -> DeleteVirtualService -> Bool
(DeleteVirtualService -> DeleteVirtualService -> Bool)
-> (DeleteVirtualService -> DeleteVirtualService -> Bool)
-> Eq DeleteVirtualService
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVirtualService -> DeleteVirtualService -> Bool
$c/= :: DeleteVirtualService -> DeleteVirtualService -> Bool
== :: DeleteVirtualService -> DeleteVirtualService -> Bool
$c== :: DeleteVirtualService -> DeleteVirtualService -> Bool
Prelude.Eq, ReadPrec [DeleteVirtualService]
ReadPrec DeleteVirtualService
Int -> ReadS DeleteVirtualService
ReadS [DeleteVirtualService]
(Int -> ReadS DeleteVirtualService)
-> ReadS [DeleteVirtualService]
-> ReadPrec DeleteVirtualService
-> ReadPrec [DeleteVirtualService]
-> Read DeleteVirtualService
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVirtualService]
$creadListPrec :: ReadPrec [DeleteVirtualService]
readPrec :: ReadPrec DeleteVirtualService
$creadPrec :: ReadPrec DeleteVirtualService
readList :: ReadS [DeleteVirtualService]
$creadList :: ReadS [DeleteVirtualService]
readsPrec :: Int -> ReadS DeleteVirtualService
$creadsPrec :: Int -> ReadS DeleteVirtualService
Prelude.Read, Int -> DeleteVirtualService -> ShowS
[DeleteVirtualService] -> ShowS
DeleteVirtualService -> String
(Int -> DeleteVirtualService -> ShowS)
-> (DeleteVirtualService -> String)
-> ([DeleteVirtualService] -> ShowS)
-> Show DeleteVirtualService
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVirtualService] -> ShowS
$cshowList :: [DeleteVirtualService] -> ShowS
show :: DeleteVirtualService -> String
$cshow :: DeleteVirtualService -> String
showsPrec :: Int -> DeleteVirtualService -> ShowS
$cshowsPrec :: Int -> DeleteVirtualService -> ShowS
Prelude.Show, (forall x. DeleteVirtualService -> Rep DeleteVirtualService x)
-> (forall x. Rep DeleteVirtualService x -> DeleteVirtualService)
-> Generic DeleteVirtualService
forall x. Rep DeleteVirtualService x -> DeleteVirtualService
forall x. DeleteVirtualService -> Rep DeleteVirtualService x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteVirtualService x -> DeleteVirtualService
$cfrom :: forall x. DeleteVirtualService -> Rep DeleteVirtualService x
Prelude.Generic)
newDeleteVirtualService ::
Prelude.Text ->
Prelude.Text ->
DeleteVirtualService
newDeleteVirtualService :: Text -> Text -> DeleteVirtualService
newDeleteVirtualService
Text
pMeshName_
Text
pVirtualServiceName_ =
DeleteVirtualService' :: Maybe Text -> Text -> Text -> DeleteVirtualService
DeleteVirtualService'
{ $sel:meshOwner:DeleteVirtualService' :: Maybe Text
meshOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:meshName:DeleteVirtualService' :: Text
meshName = Text
pMeshName_,
$sel:virtualServiceName:DeleteVirtualService' :: Text
virtualServiceName = Text
pVirtualServiceName_
}
deleteVirtualService_meshOwner :: Lens.Lens' DeleteVirtualService (Prelude.Maybe Prelude.Text)
deleteVirtualService_meshOwner :: (Maybe Text -> f (Maybe Text))
-> DeleteVirtualService -> f DeleteVirtualService
deleteVirtualService_meshOwner = (DeleteVirtualService -> Maybe Text)
-> (DeleteVirtualService -> Maybe Text -> DeleteVirtualService)
-> Lens
DeleteVirtualService DeleteVirtualService (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualService' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:DeleteVirtualService' :: DeleteVirtualService -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: DeleteVirtualService
s@DeleteVirtualService' {} Maybe Text
a -> DeleteVirtualService
s {$sel:meshOwner:DeleteVirtualService' :: Maybe Text
meshOwner = Maybe Text
a} :: DeleteVirtualService)
deleteVirtualService_meshName :: Lens.Lens' DeleteVirtualService Prelude.Text
deleteVirtualService_meshName :: (Text -> f Text) -> DeleteVirtualService -> f DeleteVirtualService
deleteVirtualService_meshName = (DeleteVirtualService -> Text)
-> (DeleteVirtualService -> Text -> DeleteVirtualService)
-> Lens DeleteVirtualService DeleteVirtualService Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualService' {Text
meshName :: Text
$sel:meshName:DeleteVirtualService' :: DeleteVirtualService -> Text
meshName} -> Text
meshName) (\s :: DeleteVirtualService
s@DeleteVirtualService' {} Text
a -> DeleteVirtualService
s {$sel:meshName:DeleteVirtualService' :: Text
meshName = Text
a} :: DeleteVirtualService)
deleteVirtualService_virtualServiceName :: Lens.Lens' DeleteVirtualService Prelude.Text
deleteVirtualService_virtualServiceName :: (Text -> f Text) -> DeleteVirtualService -> f DeleteVirtualService
deleteVirtualService_virtualServiceName = (DeleteVirtualService -> Text)
-> (DeleteVirtualService -> Text -> DeleteVirtualService)
-> Lens DeleteVirtualService DeleteVirtualService Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualService' {Text
virtualServiceName :: Text
$sel:virtualServiceName:DeleteVirtualService' :: DeleteVirtualService -> Text
virtualServiceName} -> Text
virtualServiceName) (\s :: DeleteVirtualService
s@DeleteVirtualService' {} Text
a -> DeleteVirtualService
s {$sel:virtualServiceName:DeleteVirtualService' :: Text
virtualServiceName = Text
a} :: DeleteVirtualService)
instance Core.AWSRequest DeleteVirtualService where
type
AWSResponse DeleteVirtualService =
DeleteVirtualServiceResponse
request :: DeleteVirtualService -> Request DeleteVirtualService
request = Service -> DeleteVirtualService -> Request DeleteVirtualService
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteVirtualService
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteVirtualService)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteVirtualService))
-> Logger
-> Service
-> Proxy DeleteVirtualService
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteVirtualService)))
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 -> VirtualServiceData -> DeleteVirtualServiceResponse
DeleteVirtualServiceResponse'
(Int -> VirtualServiceData -> DeleteVirtualServiceResponse)
-> Either String Int
-> Either
String (VirtualServiceData -> DeleteVirtualServiceResponse)
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 (VirtualServiceData -> DeleteVirtualServiceResponse)
-> Either String VirtualServiceData
-> Either String DeleteVirtualServiceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String VirtualServiceData
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable DeleteVirtualService
instance Prelude.NFData DeleteVirtualService
instance Core.ToHeaders DeleteVirtualService where
toHeaders :: DeleteVirtualService -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteVirtualService -> 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 DeleteVirtualService where
toPath :: DeleteVirtualService -> ByteString
toPath DeleteVirtualService' {Maybe Text
Text
virtualServiceName :: Text
meshName :: Text
meshOwner :: Maybe Text
$sel:virtualServiceName:DeleteVirtualService' :: DeleteVirtualService -> Text
$sel:meshName:DeleteVirtualService' :: DeleteVirtualService -> Text
$sel:meshOwner:DeleteVirtualService' :: DeleteVirtualService -> 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
"/virtualServices/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
virtualServiceName
]
instance Core.ToQuery DeleteVirtualService where
toQuery :: DeleteVirtualService -> QueryString
toQuery DeleteVirtualService' {Maybe Text
Text
virtualServiceName :: Text
meshName :: Text
meshOwner :: Maybe Text
$sel:virtualServiceName:DeleteVirtualService' :: DeleteVirtualService -> Text
$sel:meshName:DeleteVirtualService' :: DeleteVirtualService -> Text
$sel:meshOwner:DeleteVirtualService' :: DeleteVirtualService -> 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 DeleteVirtualServiceResponse = DeleteVirtualServiceResponse'
{
DeleteVirtualServiceResponse -> Int
httpStatus :: Prelude.Int,
DeleteVirtualServiceResponse -> VirtualServiceData
virtualService :: VirtualServiceData
}
deriving (DeleteVirtualServiceResponse
-> DeleteVirtualServiceResponse -> Bool
(DeleteVirtualServiceResponse
-> DeleteVirtualServiceResponse -> Bool)
-> (DeleteVirtualServiceResponse
-> DeleteVirtualServiceResponse -> Bool)
-> Eq DeleteVirtualServiceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVirtualServiceResponse
-> DeleteVirtualServiceResponse -> Bool
$c/= :: DeleteVirtualServiceResponse
-> DeleteVirtualServiceResponse -> Bool
== :: DeleteVirtualServiceResponse
-> DeleteVirtualServiceResponse -> Bool
$c== :: DeleteVirtualServiceResponse
-> DeleteVirtualServiceResponse -> Bool
Prelude.Eq, ReadPrec [DeleteVirtualServiceResponse]
ReadPrec DeleteVirtualServiceResponse
Int -> ReadS DeleteVirtualServiceResponse
ReadS [DeleteVirtualServiceResponse]
(Int -> ReadS DeleteVirtualServiceResponse)
-> ReadS [DeleteVirtualServiceResponse]
-> ReadPrec DeleteVirtualServiceResponse
-> ReadPrec [DeleteVirtualServiceResponse]
-> Read DeleteVirtualServiceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVirtualServiceResponse]
$creadListPrec :: ReadPrec [DeleteVirtualServiceResponse]
readPrec :: ReadPrec DeleteVirtualServiceResponse
$creadPrec :: ReadPrec DeleteVirtualServiceResponse
readList :: ReadS [DeleteVirtualServiceResponse]
$creadList :: ReadS [DeleteVirtualServiceResponse]
readsPrec :: Int -> ReadS DeleteVirtualServiceResponse
$creadsPrec :: Int -> ReadS DeleteVirtualServiceResponse
Prelude.Read, Int -> DeleteVirtualServiceResponse -> ShowS
[DeleteVirtualServiceResponse] -> ShowS
DeleteVirtualServiceResponse -> String
(Int -> DeleteVirtualServiceResponse -> ShowS)
-> (DeleteVirtualServiceResponse -> String)
-> ([DeleteVirtualServiceResponse] -> ShowS)
-> Show DeleteVirtualServiceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVirtualServiceResponse] -> ShowS
$cshowList :: [DeleteVirtualServiceResponse] -> ShowS
show :: DeleteVirtualServiceResponse -> String
$cshow :: DeleteVirtualServiceResponse -> String
showsPrec :: Int -> DeleteVirtualServiceResponse -> ShowS
$cshowsPrec :: Int -> DeleteVirtualServiceResponse -> ShowS
Prelude.Show, (forall x.
DeleteVirtualServiceResponse -> Rep DeleteVirtualServiceResponse x)
-> (forall x.
Rep DeleteVirtualServiceResponse x -> DeleteVirtualServiceResponse)
-> Generic DeleteVirtualServiceResponse
forall x.
Rep DeleteVirtualServiceResponse x -> DeleteVirtualServiceResponse
forall x.
DeleteVirtualServiceResponse -> Rep DeleteVirtualServiceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteVirtualServiceResponse x -> DeleteVirtualServiceResponse
$cfrom :: forall x.
DeleteVirtualServiceResponse -> Rep DeleteVirtualServiceResponse x
Prelude.Generic)
newDeleteVirtualServiceResponse ::
Prelude.Int ->
VirtualServiceData ->
DeleteVirtualServiceResponse
newDeleteVirtualServiceResponse :: Int -> VirtualServiceData -> DeleteVirtualServiceResponse
newDeleteVirtualServiceResponse
Int
pHttpStatus_
VirtualServiceData
pVirtualService_ =
DeleteVirtualServiceResponse' :: Int -> VirtualServiceData -> DeleteVirtualServiceResponse
DeleteVirtualServiceResponse'
{ $sel:httpStatus:DeleteVirtualServiceResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:virtualService:DeleteVirtualServiceResponse' :: VirtualServiceData
virtualService = VirtualServiceData
pVirtualService_
}
deleteVirtualServiceResponse_httpStatus :: Lens.Lens' DeleteVirtualServiceResponse Prelude.Int
deleteVirtualServiceResponse_httpStatus :: (Int -> f Int)
-> DeleteVirtualServiceResponse -> f DeleteVirtualServiceResponse
deleteVirtualServiceResponse_httpStatus = (DeleteVirtualServiceResponse -> Int)
-> (DeleteVirtualServiceResponse
-> Int -> DeleteVirtualServiceResponse)
-> Lens
DeleteVirtualServiceResponse DeleteVirtualServiceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualServiceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteVirtualServiceResponse' :: DeleteVirtualServiceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteVirtualServiceResponse
s@DeleteVirtualServiceResponse' {} Int
a -> DeleteVirtualServiceResponse
s {$sel:httpStatus:DeleteVirtualServiceResponse' :: Int
httpStatus = Int
a} :: DeleteVirtualServiceResponse)
deleteVirtualServiceResponse_virtualService :: Lens.Lens' DeleteVirtualServiceResponse VirtualServiceData
deleteVirtualServiceResponse_virtualService :: (VirtualServiceData -> f VirtualServiceData)
-> DeleteVirtualServiceResponse -> f DeleteVirtualServiceResponse
deleteVirtualServiceResponse_virtualService = (DeleteVirtualServiceResponse -> VirtualServiceData)
-> (DeleteVirtualServiceResponse
-> VirtualServiceData -> DeleteVirtualServiceResponse)
-> Lens
DeleteVirtualServiceResponse
DeleteVirtualServiceResponse
VirtualServiceData
VirtualServiceData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualServiceResponse' {VirtualServiceData
virtualService :: VirtualServiceData
$sel:virtualService:DeleteVirtualServiceResponse' :: DeleteVirtualServiceResponse -> VirtualServiceData
virtualService} -> VirtualServiceData
virtualService) (\s :: DeleteVirtualServiceResponse
s@DeleteVirtualServiceResponse' {} VirtualServiceData
a -> DeleteVirtualServiceResponse
s {$sel:virtualService:DeleteVirtualServiceResponse' :: VirtualServiceData
virtualService = VirtualServiceData
a} :: DeleteVirtualServiceResponse)
instance Prelude.NFData DeleteVirtualServiceResponse