{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectConnect.Types
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
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]
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
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. 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'
{ $sel:virtualInterfaceId:DeleteVirtualInterface' :: Text
virtualInterfaceId =
Text
pVirtualInterfaceId_
}
deleteVirtualInterface_virtualInterfaceId :: Lens.Lens' DeleteVirtualInterface Prelude.Text
deleteVirtualInterface_virtualInterfaceId :: Lens' DeleteVirtualInterface Text
deleteVirtualInterface_virtualInterfaceId = 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 :: (Service -> Service)
-> DeleteVirtualInterface -> Request DeleteVirtualInterface
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteVirtualInterface
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteVirtualInterface)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe VirtualInterfaceState
-> Int -> DeleteVirtualInterfaceResponse
DeleteVirtualInterfaceResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"virtualInterfaceState")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteVirtualInterface where
hashWithSalt :: Int -> DeleteVirtualInterface -> Int
hashWithSalt Int
_salt DeleteVirtualInterface' {Text
virtualInterfaceId :: Text
$sel:virtualInterfaceId:DeleteVirtualInterface' :: DeleteVirtualInterface -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
virtualInterfaceId
instance Prelude.NFData DeleteVirtualInterface where
rnf :: DeleteVirtualInterface -> ()
rnf DeleteVirtualInterface' {Text
virtualInterfaceId :: Text
$sel:virtualInterfaceId:DeleteVirtualInterface' :: DeleteVirtualInterface -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
virtualInterfaceId
instance Data.ToHeaders DeleteVirtualInterface where
toHeaders :: DeleteVirtualInterface -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"OvertureService.DeleteVirtualInterface" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteVirtualInterface where
toJSON :: DeleteVirtualInterface -> Value
toJSON DeleteVirtualInterface' {Text
virtualInterfaceId :: Text
$sel:virtualInterfaceId:DeleteVirtualInterface' :: DeleteVirtualInterface -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"virtualInterfaceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
virtualInterfaceId)
]
)
instance Data.ToPath DeleteVirtualInterface where
toPath :: DeleteVirtualInterface -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteVirtualInterface where
toQuery :: DeleteVirtualInterface -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:virtualInterfaceState:DeleteVirtualInterfaceResponse' :: Maybe VirtualInterfaceState
virtualInterfaceState =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteVirtualInterfaceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteVirtualInterfaceResponse_virtualInterfaceState :: Lens.Lens' DeleteVirtualInterfaceResponse (Prelude.Maybe VirtualInterfaceState)
deleteVirtualInterfaceResponse_virtualInterfaceState :: Lens' DeleteVirtualInterfaceResponse (Maybe VirtualInterfaceState)
deleteVirtualInterfaceResponse_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 :: Lens' DeleteVirtualInterfaceResponse Int
deleteVirtualInterfaceResponse_httpStatus = 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
where
rnf :: DeleteVirtualInterfaceResponse -> ()
rnf DeleteVirtualInterfaceResponse' {Int
Maybe VirtualInterfaceState
httpStatus :: Int
virtualInterfaceState :: Maybe VirtualInterfaceState
$sel:httpStatus:DeleteVirtualInterfaceResponse' :: DeleteVirtualInterfaceResponse -> Int
$sel:virtualInterfaceState:DeleteVirtualInterfaceResponse' :: DeleteVirtualInterfaceResponse -> Maybe VirtualInterfaceState
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe VirtualInterfaceState
virtualInterfaceState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus