{-# 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.DirectConnect.DeleteVirtualInterface
(
DeleteVirtualInterface (..),
newDeleteVirtualInterface,
deleteVirtualInterface_virtualInterfaceId,
DeleteVirtualInterfaceResponse (..),
newDeleteVirtualInterfaceResponse,
deleteVirtualInterfaceResponse_virtualInterfaceState,
deleteVirtualInterfaceResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types
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 DeleteVirtualInterface = DeleteVirtualInterface'
{
DeleteVirtualInterface -> Text
virtualInterfaceId :: Prelude.Text
}
deriving (DeleteVirtualInterface -> DeleteVirtualInterface -> Bool
(DeleteVirtualInterface -> DeleteVirtualInterface -> Bool)
-> (DeleteVirtualInterface -> DeleteVirtualInterface -> Bool)
-> Eq DeleteVirtualInterface
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVirtualInterface -> DeleteVirtualInterface -> Bool
$c/= :: DeleteVirtualInterface -> DeleteVirtualInterface -> Bool
== :: DeleteVirtualInterface -> DeleteVirtualInterface -> Bool
$c== :: DeleteVirtualInterface -> DeleteVirtualInterface -> Bool
Prelude.Eq, ReadPrec [DeleteVirtualInterface]
ReadPrec DeleteVirtualInterface
Int -> ReadS DeleteVirtualInterface
ReadS [DeleteVirtualInterface]
(Int -> ReadS DeleteVirtualInterface)
-> ReadS [DeleteVirtualInterface]
-> ReadPrec DeleteVirtualInterface
-> ReadPrec [DeleteVirtualInterface]
-> Read DeleteVirtualInterface
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVirtualInterface]
$creadListPrec :: ReadPrec [DeleteVirtualInterface]
readPrec :: ReadPrec DeleteVirtualInterface
$creadPrec :: ReadPrec DeleteVirtualInterface
readList :: ReadS [DeleteVirtualInterface]
$creadList :: ReadS [DeleteVirtualInterface]
readsPrec :: Int -> ReadS DeleteVirtualInterface
$creadsPrec :: Int -> ReadS DeleteVirtualInterface
Prelude.Read, Int -> DeleteVirtualInterface -> ShowS
[DeleteVirtualInterface] -> ShowS
DeleteVirtualInterface -> String
(Int -> DeleteVirtualInterface -> ShowS)
-> (DeleteVirtualInterface -> String)
-> ([DeleteVirtualInterface] -> ShowS)
-> Show DeleteVirtualInterface
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVirtualInterface] -> ShowS
$cshowList :: [DeleteVirtualInterface] -> ShowS
show :: DeleteVirtualInterface -> String
$cshow :: DeleteVirtualInterface -> String
showsPrec :: Int -> DeleteVirtualInterface -> ShowS
$cshowsPrec :: Int -> DeleteVirtualInterface -> ShowS
Prelude.Show, (forall x. DeleteVirtualInterface -> Rep DeleteVirtualInterface x)
-> (forall x.
Rep DeleteVirtualInterface x -> DeleteVirtualInterface)
-> Generic DeleteVirtualInterface
forall x. Rep DeleteVirtualInterface x -> DeleteVirtualInterface
forall x. DeleteVirtualInterface -> Rep DeleteVirtualInterface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteVirtualInterface x -> DeleteVirtualInterface
$cfrom :: forall x. DeleteVirtualInterface -> Rep DeleteVirtualInterface x
Prelude.Generic)
newDeleteVirtualInterface ::
Prelude.Text ->
DeleteVirtualInterface
newDeleteVirtualInterface :: Text -> DeleteVirtualInterface
newDeleteVirtualInterface Text
pVirtualInterfaceId_ =
DeleteVirtualInterface' :: Text -> DeleteVirtualInterface
DeleteVirtualInterface'
{ $sel:virtualInterfaceId:DeleteVirtualInterface' :: Text
virtualInterfaceId =
Text
pVirtualInterfaceId_
}
deleteVirtualInterface_virtualInterfaceId :: Lens.Lens' DeleteVirtualInterface Prelude.Text
deleteVirtualInterface_virtualInterfaceId :: (Text -> f Text)
-> DeleteVirtualInterface -> f DeleteVirtualInterface
deleteVirtualInterface_virtualInterfaceId = (DeleteVirtualInterface -> Text)
-> (DeleteVirtualInterface -> Text -> DeleteVirtualInterface)
-> Lens DeleteVirtualInterface DeleteVirtualInterface Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualInterface' {Text
virtualInterfaceId :: Text
$sel:virtualInterfaceId:DeleteVirtualInterface' :: DeleteVirtualInterface -> Text
virtualInterfaceId} -> Text
virtualInterfaceId) (\s :: DeleteVirtualInterface
s@DeleteVirtualInterface' {} Text
a -> DeleteVirtualInterface
s {$sel:virtualInterfaceId:DeleteVirtualInterface' :: Text
virtualInterfaceId = Text
a} :: DeleteVirtualInterface)
instance Core.AWSRequest DeleteVirtualInterface where
type
AWSResponse DeleteVirtualInterface =
DeleteVirtualInterfaceResponse
request :: DeleteVirtualInterface -> Request DeleteVirtualInterface
request = Service -> DeleteVirtualInterface -> Request DeleteVirtualInterface
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteVirtualInterface
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteVirtualInterface)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteVirtualInterface))
-> Logger
-> Service
-> Proxy DeleteVirtualInterface
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteVirtualInterface)))
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 ->
Maybe VirtualInterfaceState
-> Int -> DeleteVirtualInterfaceResponse
DeleteVirtualInterfaceResponse'
(Maybe VirtualInterfaceState
-> Int -> DeleteVirtualInterfaceResponse)
-> Either String (Maybe VirtualInterfaceState)
-> Either String (Int -> DeleteVirtualInterfaceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe VirtualInterfaceState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"virtualInterfaceState")
Either String (Int -> DeleteVirtualInterfaceResponse)
-> Either String Int
-> Either String DeleteVirtualInterfaceResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable DeleteVirtualInterface
instance Prelude.NFData DeleteVirtualInterface
instance Core.ToHeaders DeleteVirtualInterface where
toHeaders :: DeleteVirtualInterface -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteVirtualInterface -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"OvertureService.DeleteVirtualInterface" ::
Prelude.ByteString
),
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.ToJSON DeleteVirtualInterface where
toJSON :: DeleteVirtualInterface -> Value
toJSON DeleteVirtualInterface' {Text
virtualInterfaceId :: Text
$sel:virtualInterfaceId:DeleteVirtualInterface' :: DeleteVirtualInterface -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"virtualInterfaceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
virtualInterfaceId)
]
)
instance Core.ToPath DeleteVirtualInterface where
toPath :: DeleteVirtualInterface -> ByteString
toPath = ByteString -> DeleteVirtualInterface -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteVirtualInterface where
toQuery :: DeleteVirtualInterface -> QueryString
toQuery = QueryString -> DeleteVirtualInterface -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteVirtualInterfaceResponse = DeleteVirtualInterfaceResponse'
{
DeleteVirtualInterfaceResponse -> Maybe VirtualInterfaceState
virtualInterfaceState :: Prelude.Maybe VirtualInterfaceState,
DeleteVirtualInterfaceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteVirtualInterfaceResponse
-> DeleteVirtualInterfaceResponse -> Bool
(DeleteVirtualInterfaceResponse
-> DeleteVirtualInterfaceResponse -> Bool)
-> (DeleteVirtualInterfaceResponse
-> DeleteVirtualInterfaceResponse -> Bool)
-> Eq DeleteVirtualInterfaceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVirtualInterfaceResponse
-> DeleteVirtualInterfaceResponse -> Bool
$c/= :: DeleteVirtualInterfaceResponse
-> DeleteVirtualInterfaceResponse -> Bool
== :: DeleteVirtualInterfaceResponse
-> DeleteVirtualInterfaceResponse -> Bool
$c== :: DeleteVirtualInterfaceResponse
-> DeleteVirtualInterfaceResponse -> Bool
Prelude.Eq, ReadPrec [DeleteVirtualInterfaceResponse]
ReadPrec DeleteVirtualInterfaceResponse
Int -> ReadS DeleteVirtualInterfaceResponse
ReadS [DeleteVirtualInterfaceResponse]
(Int -> ReadS DeleteVirtualInterfaceResponse)
-> ReadS [DeleteVirtualInterfaceResponse]
-> ReadPrec DeleteVirtualInterfaceResponse
-> ReadPrec [DeleteVirtualInterfaceResponse]
-> Read DeleteVirtualInterfaceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVirtualInterfaceResponse]
$creadListPrec :: ReadPrec [DeleteVirtualInterfaceResponse]
readPrec :: ReadPrec DeleteVirtualInterfaceResponse
$creadPrec :: ReadPrec DeleteVirtualInterfaceResponse
readList :: ReadS [DeleteVirtualInterfaceResponse]
$creadList :: ReadS [DeleteVirtualInterfaceResponse]
readsPrec :: Int -> ReadS DeleteVirtualInterfaceResponse
$creadsPrec :: Int -> ReadS DeleteVirtualInterfaceResponse
Prelude.Read, Int -> DeleteVirtualInterfaceResponse -> ShowS
[DeleteVirtualInterfaceResponse] -> ShowS
DeleteVirtualInterfaceResponse -> String
(Int -> DeleteVirtualInterfaceResponse -> ShowS)
-> (DeleteVirtualInterfaceResponse -> String)
-> ([DeleteVirtualInterfaceResponse] -> ShowS)
-> Show DeleteVirtualInterfaceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVirtualInterfaceResponse] -> ShowS
$cshowList :: [DeleteVirtualInterfaceResponse] -> ShowS
show :: DeleteVirtualInterfaceResponse -> String
$cshow :: DeleteVirtualInterfaceResponse -> String
showsPrec :: Int -> DeleteVirtualInterfaceResponse -> ShowS
$cshowsPrec :: Int -> DeleteVirtualInterfaceResponse -> ShowS
Prelude.Show, (forall x.
DeleteVirtualInterfaceResponse
-> Rep DeleteVirtualInterfaceResponse x)
-> (forall x.
Rep DeleteVirtualInterfaceResponse x
-> DeleteVirtualInterfaceResponse)
-> Generic DeleteVirtualInterfaceResponse
forall x.
Rep DeleteVirtualInterfaceResponse x
-> DeleteVirtualInterfaceResponse
forall x.
DeleteVirtualInterfaceResponse
-> Rep DeleteVirtualInterfaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteVirtualInterfaceResponse x
-> DeleteVirtualInterfaceResponse
$cfrom :: forall x.
DeleteVirtualInterfaceResponse
-> Rep DeleteVirtualInterfaceResponse x
Prelude.Generic)
newDeleteVirtualInterfaceResponse ::
Prelude.Int ->
DeleteVirtualInterfaceResponse
newDeleteVirtualInterfaceResponse :: Int -> DeleteVirtualInterfaceResponse
newDeleteVirtualInterfaceResponse Int
pHttpStatus_ =
DeleteVirtualInterfaceResponse' :: Maybe VirtualInterfaceState
-> Int -> DeleteVirtualInterfaceResponse
DeleteVirtualInterfaceResponse'
{ $sel:virtualInterfaceState:DeleteVirtualInterfaceResponse' :: Maybe VirtualInterfaceState
virtualInterfaceState =
Maybe VirtualInterfaceState
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteVirtualInterfaceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteVirtualInterfaceResponse_virtualInterfaceState :: Lens.Lens' DeleteVirtualInterfaceResponse (Prelude.Maybe VirtualInterfaceState)
deleteVirtualInterfaceResponse_virtualInterfaceState :: (Maybe VirtualInterfaceState -> f (Maybe VirtualInterfaceState))
-> DeleteVirtualInterfaceResponse
-> f DeleteVirtualInterfaceResponse
deleteVirtualInterfaceResponse_virtualInterfaceState = (DeleteVirtualInterfaceResponse -> Maybe VirtualInterfaceState)
-> (DeleteVirtualInterfaceResponse
-> Maybe VirtualInterfaceState -> DeleteVirtualInterfaceResponse)
-> Lens
DeleteVirtualInterfaceResponse
DeleteVirtualInterfaceResponse
(Maybe VirtualInterfaceState)
(Maybe VirtualInterfaceState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualInterfaceResponse' {Maybe VirtualInterfaceState
virtualInterfaceState :: Maybe VirtualInterfaceState
$sel:virtualInterfaceState:DeleteVirtualInterfaceResponse' :: DeleteVirtualInterfaceResponse -> Maybe VirtualInterfaceState
virtualInterfaceState} -> Maybe VirtualInterfaceState
virtualInterfaceState) (\s :: DeleteVirtualInterfaceResponse
s@DeleteVirtualInterfaceResponse' {} Maybe VirtualInterfaceState
a -> DeleteVirtualInterfaceResponse
s {$sel:virtualInterfaceState:DeleteVirtualInterfaceResponse' :: Maybe VirtualInterfaceState
virtualInterfaceState = Maybe VirtualInterfaceState
a} :: DeleteVirtualInterfaceResponse)
deleteVirtualInterfaceResponse_httpStatus :: Lens.Lens' DeleteVirtualInterfaceResponse Prelude.Int
deleteVirtualInterfaceResponse_httpStatus :: (Int -> f Int)
-> DeleteVirtualInterfaceResponse
-> f DeleteVirtualInterfaceResponse
deleteVirtualInterfaceResponse_httpStatus = (DeleteVirtualInterfaceResponse -> Int)
-> (DeleteVirtualInterfaceResponse
-> Int -> DeleteVirtualInterfaceResponse)
-> Lens
DeleteVirtualInterfaceResponse
DeleteVirtualInterfaceResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualInterfaceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteVirtualInterfaceResponse' :: DeleteVirtualInterfaceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteVirtualInterfaceResponse
s@DeleteVirtualInterfaceResponse' {} Int
a -> DeleteVirtualInterfaceResponse
s {$sel:httpStatus:DeleteVirtualInterfaceResponse' :: Int
httpStatus = Int
a} :: DeleteVirtualInterfaceResponse)
instance
Prelude.NFData
DeleteVirtualInterfaceResponse