{-# 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.DeleteDirectConnectGateway
(
DeleteDirectConnectGateway (..),
newDeleteDirectConnectGateway,
deleteDirectConnectGateway_directConnectGatewayId,
DeleteDirectConnectGatewayResponse (..),
newDeleteDirectConnectGatewayResponse,
deleteDirectConnectGatewayResponse_directConnectGateway,
deleteDirectConnectGatewayResponse_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 DeleteDirectConnectGateway = DeleteDirectConnectGateway'
{
DeleteDirectConnectGateway -> Text
directConnectGatewayId :: Prelude.Text
}
deriving (DeleteDirectConnectGateway -> DeleteDirectConnectGateway -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDirectConnectGateway -> DeleteDirectConnectGateway -> Bool
$c/= :: DeleteDirectConnectGateway -> DeleteDirectConnectGateway -> Bool
== :: DeleteDirectConnectGateway -> DeleteDirectConnectGateway -> Bool
$c== :: DeleteDirectConnectGateway -> DeleteDirectConnectGateway -> Bool
Prelude.Eq, ReadPrec [DeleteDirectConnectGateway]
ReadPrec DeleteDirectConnectGateway
Int -> ReadS DeleteDirectConnectGateway
ReadS [DeleteDirectConnectGateway]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDirectConnectGateway]
$creadListPrec :: ReadPrec [DeleteDirectConnectGateway]
readPrec :: ReadPrec DeleteDirectConnectGateway
$creadPrec :: ReadPrec DeleteDirectConnectGateway
readList :: ReadS [DeleteDirectConnectGateway]
$creadList :: ReadS [DeleteDirectConnectGateway]
readsPrec :: Int -> ReadS DeleteDirectConnectGateway
$creadsPrec :: Int -> ReadS DeleteDirectConnectGateway
Prelude.Read, Int -> DeleteDirectConnectGateway -> ShowS
[DeleteDirectConnectGateway] -> ShowS
DeleteDirectConnectGateway -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDirectConnectGateway] -> ShowS
$cshowList :: [DeleteDirectConnectGateway] -> ShowS
show :: DeleteDirectConnectGateway -> String
$cshow :: DeleteDirectConnectGateway -> String
showsPrec :: Int -> DeleteDirectConnectGateway -> ShowS
$cshowsPrec :: Int -> DeleteDirectConnectGateway -> ShowS
Prelude.Show, forall x.
Rep DeleteDirectConnectGateway x -> DeleteDirectConnectGateway
forall x.
DeleteDirectConnectGateway -> Rep DeleteDirectConnectGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDirectConnectGateway x -> DeleteDirectConnectGateway
$cfrom :: forall x.
DeleteDirectConnectGateway -> Rep DeleteDirectConnectGateway x
Prelude.Generic)
newDeleteDirectConnectGateway ::
Prelude.Text ->
DeleteDirectConnectGateway
newDeleteDirectConnectGateway :: Text -> DeleteDirectConnectGateway
newDeleteDirectConnectGateway
Text
pDirectConnectGatewayId_ =
DeleteDirectConnectGateway'
{ $sel:directConnectGatewayId:DeleteDirectConnectGateway' :: Text
directConnectGatewayId =
Text
pDirectConnectGatewayId_
}
deleteDirectConnectGateway_directConnectGatewayId :: Lens.Lens' DeleteDirectConnectGateway Prelude.Text
deleteDirectConnectGateway_directConnectGatewayId :: Lens' DeleteDirectConnectGateway Text
deleteDirectConnectGateway_directConnectGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDirectConnectGateway' {Text
directConnectGatewayId :: Text
$sel:directConnectGatewayId:DeleteDirectConnectGateway' :: DeleteDirectConnectGateway -> Text
directConnectGatewayId} -> Text
directConnectGatewayId) (\s :: DeleteDirectConnectGateway
s@DeleteDirectConnectGateway' {} Text
a -> DeleteDirectConnectGateway
s {$sel:directConnectGatewayId:DeleteDirectConnectGateway' :: Text
directConnectGatewayId = Text
a} :: DeleteDirectConnectGateway)
instance Core.AWSRequest DeleteDirectConnectGateway where
type
AWSResponse DeleteDirectConnectGateway =
DeleteDirectConnectGatewayResponse
request :: (Service -> Service)
-> DeleteDirectConnectGateway -> Request DeleteDirectConnectGateway
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 DeleteDirectConnectGateway
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDirectConnectGateway)))
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 DirectConnectGateway
-> Int -> DeleteDirectConnectGatewayResponse
DeleteDirectConnectGatewayResponse'
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
"directConnectGateway")
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 DeleteDirectConnectGateway where
hashWithSalt :: Int -> DeleteDirectConnectGateway -> Int
hashWithSalt Int
_salt DeleteDirectConnectGateway' {Text
directConnectGatewayId :: Text
$sel:directConnectGatewayId:DeleteDirectConnectGateway' :: DeleteDirectConnectGateway -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
directConnectGatewayId
instance Prelude.NFData DeleteDirectConnectGateway where
rnf :: DeleteDirectConnectGateway -> ()
rnf DeleteDirectConnectGateway' {Text
directConnectGatewayId :: Text
$sel:directConnectGatewayId:DeleteDirectConnectGateway' :: DeleteDirectConnectGateway -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
directConnectGatewayId
instance Data.ToHeaders DeleteDirectConnectGateway where
toHeaders :: DeleteDirectConnectGateway -> 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.DeleteDirectConnectGateway" ::
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 DeleteDirectConnectGateway where
toJSON :: DeleteDirectConnectGateway -> Value
toJSON DeleteDirectConnectGateway' {Text
directConnectGatewayId :: Text
$sel:directConnectGatewayId:DeleteDirectConnectGateway' :: DeleteDirectConnectGateway -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"directConnectGatewayId"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
directConnectGatewayId
)
]
)
instance Data.ToPath DeleteDirectConnectGateway where
toPath :: DeleteDirectConnectGateway -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteDirectConnectGateway where
toQuery :: DeleteDirectConnectGateway -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteDirectConnectGatewayResponse = DeleteDirectConnectGatewayResponse'
{
DeleteDirectConnectGatewayResponse -> Maybe DirectConnectGateway
directConnectGateway :: Prelude.Maybe DirectConnectGateway,
DeleteDirectConnectGatewayResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDirectConnectGatewayResponse
-> DeleteDirectConnectGatewayResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDirectConnectGatewayResponse
-> DeleteDirectConnectGatewayResponse -> Bool
$c/= :: DeleteDirectConnectGatewayResponse
-> DeleteDirectConnectGatewayResponse -> Bool
== :: DeleteDirectConnectGatewayResponse
-> DeleteDirectConnectGatewayResponse -> Bool
$c== :: DeleteDirectConnectGatewayResponse
-> DeleteDirectConnectGatewayResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDirectConnectGatewayResponse]
ReadPrec DeleteDirectConnectGatewayResponse
Int -> ReadS DeleteDirectConnectGatewayResponse
ReadS [DeleteDirectConnectGatewayResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDirectConnectGatewayResponse]
$creadListPrec :: ReadPrec [DeleteDirectConnectGatewayResponse]
readPrec :: ReadPrec DeleteDirectConnectGatewayResponse
$creadPrec :: ReadPrec DeleteDirectConnectGatewayResponse
readList :: ReadS [DeleteDirectConnectGatewayResponse]
$creadList :: ReadS [DeleteDirectConnectGatewayResponse]
readsPrec :: Int -> ReadS DeleteDirectConnectGatewayResponse
$creadsPrec :: Int -> ReadS DeleteDirectConnectGatewayResponse
Prelude.Read, Int -> DeleteDirectConnectGatewayResponse -> ShowS
[DeleteDirectConnectGatewayResponse] -> ShowS
DeleteDirectConnectGatewayResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDirectConnectGatewayResponse] -> ShowS
$cshowList :: [DeleteDirectConnectGatewayResponse] -> ShowS
show :: DeleteDirectConnectGatewayResponse -> String
$cshow :: DeleteDirectConnectGatewayResponse -> String
showsPrec :: Int -> DeleteDirectConnectGatewayResponse -> ShowS
$cshowsPrec :: Int -> DeleteDirectConnectGatewayResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteDirectConnectGatewayResponse x
-> DeleteDirectConnectGatewayResponse
forall x.
DeleteDirectConnectGatewayResponse
-> Rep DeleteDirectConnectGatewayResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDirectConnectGatewayResponse x
-> DeleteDirectConnectGatewayResponse
$cfrom :: forall x.
DeleteDirectConnectGatewayResponse
-> Rep DeleteDirectConnectGatewayResponse x
Prelude.Generic)
newDeleteDirectConnectGatewayResponse ::
Prelude.Int ->
DeleteDirectConnectGatewayResponse
newDeleteDirectConnectGatewayResponse :: Int -> DeleteDirectConnectGatewayResponse
newDeleteDirectConnectGatewayResponse Int
pHttpStatus_ =
DeleteDirectConnectGatewayResponse'
{ $sel:directConnectGateway:DeleteDirectConnectGatewayResponse' :: Maybe DirectConnectGateway
directConnectGateway =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteDirectConnectGatewayResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteDirectConnectGatewayResponse_directConnectGateway :: Lens.Lens' DeleteDirectConnectGatewayResponse (Prelude.Maybe DirectConnectGateway)
deleteDirectConnectGatewayResponse_directConnectGateway :: Lens'
DeleteDirectConnectGatewayResponse (Maybe DirectConnectGateway)
deleteDirectConnectGatewayResponse_directConnectGateway = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDirectConnectGatewayResponse' {Maybe DirectConnectGateway
directConnectGateway :: Maybe DirectConnectGateway
$sel:directConnectGateway:DeleteDirectConnectGatewayResponse' :: DeleteDirectConnectGatewayResponse -> Maybe DirectConnectGateway
directConnectGateway} -> Maybe DirectConnectGateway
directConnectGateway) (\s :: DeleteDirectConnectGatewayResponse
s@DeleteDirectConnectGatewayResponse' {} Maybe DirectConnectGateway
a -> DeleteDirectConnectGatewayResponse
s {$sel:directConnectGateway:DeleteDirectConnectGatewayResponse' :: Maybe DirectConnectGateway
directConnectGateway = Maybe DirectConnectGateway
a} :: DeleteDirectConnectGatewayResponse)
deleteDirectConnectGatewayResponse_httpStatus :: Lens.Lens' DeleteDirectConnectGatewayResponse Prelude.Int
deleteDirectConnectGatewayResponse_httpStatus :: Lens' DeleteDirectConnectGatewayResponse Int
deleteDirectConnectGatewayResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDirectConnectGatewayResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDirectConnectGatewayResponse' :: DeleteDirectConnectGatewayResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteDirectConnectGatewayResponse
s@DeleteDirectConnectGatewayResponse' {} Int
a -> DeleteDirectConnectGatewayResponse
s {$sel:httpStatus:DeleteDirectConnectGatewayResponse' :: Int
httpStatus = Int
a} :: DeleteDirectConnectGatewayResponse)
instance
Prelude.NFData
DeleteDirectConnectGatewayResponse
where
rnf :: DeleteDirectConnectGatewayResponse -> ()
rnf DeleteDirectConnectGatewayResponse' {Int
Maybe DirectConnectGateway
httpStatus :: Int
directConnectGateway :: Maybe DirectConnectGateway
$sel:httpStatus:DeleteDirectConnectGatewayResponse' :: DeleteDirectConnectGatewayResponse -> Int
$sel:directConnectGateway:DeleteDirectConnectGatewayResponse' :: DeleteDirectConnectGatewayResponse -> Maybe DirectConnectGateway
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DirectConnectGateway
directConnectGateway
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus