{-# 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.DeleteVirtualRouter
(
DeleteVirtualRouter (..),
newDeleteVirtualRouter,
deleteVirtualRouter_meshOwner,
deleteVirtualRouter_meshName,
deleteVirtualRouter_virtualRouterName,
DeleteVirtualRouterResponse (..),
newDeleteVirtualRouterResponse,
deleteVirtualRouterResponse_httpStatus,
deleteVirtualRouterResponse_virtualRouter,
)
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 DeleteVirtualRouter = DeleteVirtualRouter'
{
DeleteVirtualRouter -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
DeleteVirtualRouter -> Text
meshName :: Prelude.Text,
DeleteVirtualRouter -> Text
virtualRouterName :: Prelude.Text
}
deriving (DeleteVirtualRouter -> DeleteVirtualRouter -> Bool
(DeleteVirtualRouter -> DeleteVirtualRouter -> Bool)
-> (DeleteVirtualRouter -> DeleteVirtualRouter -> Bool)
-> Eq DeleteVirtualRouter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVirtualRouter -> DeleteVirtualRouter -> Bool
$c/= :: DeleteVirtualRouter -> DeleteVirtualRouter -> Bool
== :: DeleteVirtualRouter -> DeleteVirtualRouter -> Bool
$c== :: DeleteVirtualRouter -> DeleteVirtualRouter -> Bool
Prelude.Eq, ReadPrec [DeleteVirtualRouter]
ReadPrec DeleteVirtualRouter
Int -> ReadS DeleteVirtualRouter
ReadS [DeleteVirtualRouter]
(Int -> ReadS DeleteVirtualRouter)
-> ReadS [DeleteVirtualRouter]
-> ReadPrec DeleteVirtualRouter
-> ReadPrec [DeleteVirtualRouter]
-> Read DeleteVirtualRouter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVirtualRouter]
$creadListPrec :: ReadPrec [DeleteVirtualRouter]
readPrec :: ReadPrec DeleteVirtualRouter
$creadPrec :: ReadPrec DeleteVirtualRouter
readList :: ReadS [DeleteVirtualRouter]
$creadList :: ReadS [DeleteVirtualRouter]
readsPrec :: Int -> ReadS DeleteVirtualRouter
$creadsPrec :: Int -> ReadS DeleteVirtualRouter
Prelude.Read, Int -> DeleteVirtualRouter -> ShowS
[DeleteVirtualRouter] -> ShowS
DeleteVirtualRouter -> String
(Int -> DeleteVirtualRouter -> ShowS)
-> (DeleteVirtualRouter -> String)
-> ([DeleteVirtualRouter] -> ShowS)
-> Show DeleteVirtualRouter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVirtualRouter] -> ShowS
$cshowList :: [DeleteVirtualRouter] -> ShowS
show :: DeleteVirtualRouter -> String
$cshow :: DeleteVirtualRouter -> String
showsPrec :: Int -> DeleteVirtualRouter -> ShowS
$cshowsPrec :: Int -> DeleteVirtualRouter -> ShowS
Prelude.Show, (forall x. DeleteVirtualRouter -> Rep DeleteVirtualRouter x)
-> (forall x. Rep DeleteVirtualRouter x -> DeleteVirtualRouter)
-> Generic DeleteVirtualRouter
forall x. Rep DeleteVirtualRouter x -> DeleteVirtualRouter
forall x. DeleteVirtualRouter -> Rep DeleteVirtualRouter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteVirtualRouter x -> DeleteVirtualRouter
$cfrom :: forall x. DeleteVirtualRouter -> Rep DeleteVirtualRouter x
Prelude.Generic)
newDeleteVirtualRouter ::
Prelude.Text ->
Prelude.Text ->
DeleteVirtualRouter
newDeleteVirtualRouter :: Text -> Text -> DeleteVirtualRouter
newDeleteVirtualRouter Text
pMeshName_ Text
pVirtualRouterName_ =
DeleteVirtualRouter' :: Maybe Text -> Text -> Text -> DeleteVirtualRouter
DeleteVirtualRouter'
{ $sel:meshOwner:DeleteVirtualRouter' :: Maybe Text
meshOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:meshName:DeleteVirtualRouter' :: Text
meshName = Text
pMeshName_,
$sel:virtualRouterName:DeleteVirtualRouter' :: Text
virtualRouterName = Text
pVirtualRouterName_
}
deleteVirtualRouter_meshOwner :: Lens.Lens' DeleteVirtualRouter (Prelude.Maybe Prelude.Text)
deleteVirtualRouter_meshOwner :: (Maybe Text -> f (Maybe Text))
-> DeleteVirtualRouter -> f DeleteVirtualRouter
deleteVirtualRouter_meshOwner = (DeleteVirtualRouter -> Maybe Text)
-> (DeleteVirtualRouter -> Maybe Text -> DeleteVirtualRouter)
-> Lens
DeleteVirtualRouter DeleteVirtualRouter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualRouter' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:DeleteVirtualRouter' :: DeleteVirtualRouter -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: DeleteVirtualRouter
s@DeleteVirtualRouter' {} Maybe Text
a -> DeleteVirtualRouter
s {$sel:meshOwner:DeleteVirtualRouter' :: Maybe Text
meshOwner = Maybe Text
a} :: DeleteVirtualRouter)
deleteVirtualRouter_meshName :: Lens.Lens' DeleteVirtualRouter Prelude.Text
deleteVirtualRouter_meshName :: (Text -> f Text) -> DeleteVirtualRouter -> f DeleteVirtualRouter
deleteVirtualRouter_meshName = (DeleteVirtualRouter -> Text)
-> (DeleteVirtualRouter -> Text -> DeleteVirtualRouter)
-> Lens DeleteVirtualRouter DeleteVirtualRouter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualRouter' {Text
meshName :: Text
$sel:meshName:DeleteVirtualRouter' :: DeleteVirtualRouter -> Text
meshName} -> Text
meshName) (\s :: DeleteVirtualRouter
s@DeleteVirtualRouter' {} Text
a -> DeleteVirtualRouter
s {$sel:meshName:DeleteVirtualRouter' :: Text
meshName = Text
a} :: DeleteVirtualRouter)
deleteVirtualRouter_virtualRouterName :: Lens.Lens' DeleteVirtualRouter Prelude.Text
deleteVirtualRouter_virtualRouterName :: (Text -> f Text) -> DeleteVirtualRouter -> f DeleteVirtualRouter
deleteVirtualRouter_virtualRouterName = (DeleteVirtualRouter -> Text)
-> (DeleteVirtualRouter -> Text -> DeleteVirtualRouter)
-> Lens DeleteVirtualRouter DeleteVirtualRouter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualRouter' {Text
virtualRouterName :: Text
$sel:virtualRouterName:DeleteVirtualRouter' :: DeleteVirtualRouter -> Text
virtualRouterName} -> Text
virtualRouterName) (\s :: DeleteVirtualRouter
s@DeleteVirtualRouter' {} Text
a -> DeleteVirtualRouter
s {$sel:virtualRouterName:DeleteVirtualRouter' :: Text
virtualRouterName = Text
a} :: DeleteVirtualRouter)
instance Core.AWSRequest DeleteVirtualRouter where
type
AWSResponse DeleteVirtualRouter =
DeleteVirtualRouterResponse
request :: DeleteVirtualRouter -> Request DeleteVirtualRouter
request = Service -> DeleteVirtualRouter -> Request DeleteVirtualRouter
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteVirtualRouter
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteVirtualRouter)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteVirtualRouter))
-> Logger
-> Service
-> Proxy DeleteVirtualRouter
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteVirtualRouter)))
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 -> VirtualRouterData -> DeleteVirtualRouterResponse
DeleteVirtualRouterResponse'
(Int -> VirtualRouterData -> DeleteVirtualRouterResponse)
-> Either String Int
-> Either String (VirtualRouterData -> DeleteVirtualRouterResponse)
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 (VirtualRouterData -> DeleteVirtualRouterResponse)
-> Either String VirtualRouterData
-> Either String DeleteVirtualRouterResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String VirtualRouterData
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable DeleteVirtualRouter
instance Prelude.NFData DeleteVirtualRouter
instance Core.ToHeaders DeleteVirtualRouter where
toHeaders :: DeleteVirtualRouter -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteVirtualRouter -> 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 DeleteVirtualRouter where
toPath :: DeleteVirtualRouter -> ByteString
toPath DeleteVirtualRouter' {Maybe Text
Text
virtualRouterName :: Text
meshName :: Text
meshOwner :: Maybe Text
$sel:virtualRouterName:DeleteVirtualRouter' :: DeleteVirtualRouter -> Text
$sel:meshName:DeleteVirtualRouter' :: DeleteVirtualRouter -> Text
$sel:meshOwner:DeleteVirtualRouter' :: DeleteVirtualRouter -> 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
"/virtualRouters/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
virtualRouterName
]
instance Core.ToQuery DeleteVirtualRouter where
toQuery :: DeleteVirtualRouter -> QueryString
toQuery DeleteVirtualRouter' {Maybe Text
Text
virtualRouterName :: Text
meshName :: Text
meshOwner :: Maybe Text
$sel:virtualRouterName:DeleteVirtualRouter' :: DeleteVirtualRouter -> Text
$sel:meshName:DeleteVirtualRouter' :: DeleteVirtualRouter -> Text
$sel:meshOwner:DeleteVirtualRouter' :: DeleteVirtualRouter -> 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 DeleteVirtualRouterResponse = DeleteVirtualRouterResponse'
{
DeleteVirtualRouterResponse -> Int
httpStatus :: Prelude.Int,
DeleteVirtualRouterResponse -> VirtualRouterData
virtualRouter :: VirtualRouterData
}
deriving (DeleteVirtualRouterResponse -> DeleteVirtualRouterResponse -> Bool
(DeleteVirtualRouterResponse
-> DeleteVirtualRouterResponse -> Bool)
-> (DeleteVirtualRouterResponse
-> DeleteVirtualRouterResponse -> Bool)
-> Eq DeleteVirtualRouterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVirtualRouterResponse -> DeleteVirtualRouterResponse -> Bool
$c/= :: DeleteVirtualRouterResponse -> DeleteVirtualRouterResponse -> Bool
== :: DeleteVirtualRouterResponse -> DeleteVirtualRouterResponse -> Bool
$c== :: DeleteVirtualRouterResponse -> DeleteVirtualRouterResponse -> Bool
Prelude.Eq, ReadPrec [DeleteVirtualRouterResponse]
ReadPrec DeleteVirtualRouterResponse
Int -> ReadS DeleteVirtualRouterResponse
ReadS [DeleteVirtualRouterResponse]
(Int -> ReadS DeleteVirtualRouterResponse)
-> ReadS [DeleteVirtualRouterResponse]
-> ReadPrec DeleteVirtualRouterResponse
-> ReadPrec [DeleteVirtualRouterResponse]
-> Read DeleteVirtualRouterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVirtualRouterResponse]
$creadListPrec :: ReadPrec [DeleteVirtualRouterResponse]
readPrec :: ReadPrec DeleteVirtualRouterResponse
$creadPrec :: ReadPrec DeleteVirtualRouterResponse
readList :: ReadS [DeleteVirtualRouterResponse]
$creadList :: ReadS [DeleteVirtualRouterResponse]
readsPrec :: Int -> ReadS DeleteVirtualRouterResponse
$creadsPrec :: Int -> ReadS DeleteVirtualRouterResponse
Prelude.Read, Int -> DeleteVirtualRouterResponse -> ShowS
[DeleteVirtualRouterResponse] -> ShowS
DeleteVirtualRouterResponse -> String
(Int -> DeleteVirtualRouterResponse -> ShowS)
-> (DeleteVirtualRouterResponse -> String)
-> ([DeleteVirtualRouterResponse] -> ShowS)
-> Show DeleteVirtualRouterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVirtualRouterResponse] -> ShowS
$cshowList :: [DeleteVirtualRouterResponse] -> ShowS
show :: DeleteVirtualRouterResponse -> String
$cshow :: DeleteVirtualRouterResponse -> String
showsPrec :: Int -> DeleteVirtualRouterResponse -> ShowS
$cshowsPrec :: Int -> DeleteVirtualRouterResponse -> ShowS
Prelude.Show, (forall x.
DeleteVirtualRouterResponse -> Rep DeleteVirtualRouterResponse x)
-> (forall x.
Rep DeleteVirtualRouterResponse x -> DeleteVirtualRouterResponse)
-> Generic DeleteVirtualRouterResponse
forall x.
Rep DeleteVirtualRouterResponse x -> DeleteVirtualRouterResponse
forall x.
DeleteVirtualRouterResponse -> Rep DeleteVirtualRouterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteVirtualRouterResponse x -> DeleteVirtualRouterResponse
$cfrom :: forall x.
DeleteVirtualRouterResponse -> Rep DeleteVirtualRouterResponse x
Prelude.Generic)
newDeleteVirtualRouterResponse ::
Prelude.Int ->
VirtualRouterData ->
DeleteVirtualRouterResponse
newDeleteVirtualRouterResponse :: Int -> VirtualRouterData -> DeleteVirtualRouterResponse
newDeleteVirtualRouterResponse
Int
pHttpStatus_
VirtualRouterData
pVirtualRouter_ =
DeleteVirtualRouterResponse' :: Int -> VirtualRouterData -> DeleteVirtualRouterResponse
DeleteVirtualRouterResponse'
{ $sel:httpStatus:DeleteVirtualRouterResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:virtualRouter:DeleteVirtualRouterResponse' :: VirtualRouterData
virtualRouter = VirtualRouterData
pVirtualRouter_
}
deleteVirtualRouterResponse_httpStatus :: Lens.Lens' DeleteVirtualRouterResponse Prelude.Int
deleteVirtualRouterResponse_httpStatus :: (Int -> f Int)
-> DeleteVirtualRouterResponse -> f DeleteVirtualRouterResponse
deleteVirtualRouterResponse_httpStatus = (DeleteVirtualRouterResponse -> Int)
-> (DeleteVirtualRouterResponse
-> Int -> DeleteVirtualRouterResponse)
-> Lens
DeleteVirtualRouterResponse DeleteVirtualRouterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualRouterResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteVirtualRouterResponse' :: DeleteVirtualRouterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteVirtualRouterResponse
s@DeleteVirtualRouterResponse' {} Int
a -> DeleteVirtualRouterResponse
s {$sel:httpStatus:DeleteVirtualRouterResponse' :: Int
httpStatus = Int
a} :: DeleteVirtualRouterResponse)
deleteVirtualRouterResponse_virtualRouter :: Lens.Lens' DeleteVirtualRouterResponse VirtualRouterData
deleteVirtualRouterResponse_virtualRouter :: (VirtualRouterData -> f VirtualRouterData)
-> DeleteVirtualRouterResponse -> f DeleteVirtualRouterResponse
deleteVirtualRouterResponse_virtualRouter = (DeleteVirtualRouterResponse -> VirtualRouterData)
-> (DeleteVirtualRouterResponse
-> VirtualRouterData -> DeleteVirtualRouterResponse)
-> Lens
DeleteVirtualRouterResponse
DeleteVirtualRouterResponse
VirtualRouterData
VirtualRouterData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualRouterResponse' {VirtualRouterData
virtualRouter :: VirtualRouterData
$sel:virtualRouter:DeleteVirtualRouterResponse' :: DeleteVirtualRouterResponse -> VirtualRouterData
virtualRouter} -> VirtualRouterData
virtualRouter) (\s :: DeleteVirtualRouterResponse
s@DeleteVirtualRouterResponse' {} VirtualRouterData
a -> DeleteVirtualRouterResponse
s {$sel:virtualRouter:DeleteVirtualRouterResponse' :: VirtualRouterData
virtualRouter = VirtualRouterData
a} :: DeleteVirtualRouterResponse)
instance Prelude.NFData DeleteVirtualRouterResponse