{-# 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.NetworkManager.DeleteGlobalNetwork
(
DeleteGlobalNetwork (..),
newDeleteGlobalNetwork,
deleteGlobalNetwork_globalNetworkId,
DeleteGlobalNetworkResponse (..),
newDeleteGlobalNetworkResponse,
deleteGlobalNetworkResponse_globalNetwork,
deleteGlobalNetworkResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.NetworkManager.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteGlobalNetwork = DeleteGlobalNetwork'
{
DeleteGlobalNetwork -> Text
globalNetworkId :: Prelude.Text
}
deriving (DeleteGlobalNetwork -> DeleteGlobalNetwork -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGlobalNetwork -> DeleteGlobalNetwork -> Bool
$c/= :: DeleteGlobalNetwork -> DeleteGlobalNetwork -> Bool
== :: DeleteGlobalNetwork -> DeleteGlobalNetwork -> Bool
$c== :: DeleteGlobalNetwork -> DeleteGlobalNetwork -> Bool
Prelude.Eq, ReadPrec [DeleteGlobalNetwork]
ReadPrec DeleteGlobalNetwork
Int -> ReadS DeleteGlobalNetwork
ReadS [DeleteGlobalNetwork]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGlobalNetwork]
$creadListPrec :: ReadPrec [DeleteGlobalNetwork]
readPrec :: ReadPrec DeleteGlobalNetwork
$creadPrec :: ReadPrec DeleteGlobalNetwork
readList :: ReadS [DeleteGlobalNetwork]
$creadList :: ReadS [DeleteGlobalNetwork]
readsPrec :: Int -> ReadS DeleteGlobalNetwork
$creadsPrec :: Int -> ReadS DeleteGlobalNetwork
Prelude.Read, Int -> DeleteGlobalNetwork -> ShowS
[DeleteGlobalNetwork] -> ShowS
DeleteGlobalNetwork -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGlobalNetwork] -> ShowS
$cshowList :: [DeleteGlobalNetwork] -> ShowS
show :: DeleteGlobalNetwork -> String
$cshow :: DeleteGlobalNetwork -> String
showsPrec :: Int -> DeleteGlobalNetwork -> ShowS
$cshowsPrec :: Int -> DeleteGlobalNetwork -> ShowS
Prelude.Show, forall x. Rep DeleteGlobalNetwork x -> DeleteGlobalNetwork
forall x. DeleteGlobalNetwork -> Rep DeleteGlobalNetwork x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteGlobalNetwork x -> DeleteGlobalNetwork
$cfrom :: forall x. DeleteGlobalNetwork -> Rep DeleteGlobalNetwork x
Prelude.Generic)
newDeleteGlobalNetwork ::
Prelude.Text ->
DeleteGlobalNetwork
newDeleteGlobalNetwork :: Text -> DeleteGlobalNetwork
newDeleteGlobalNetwork Text
pGlobalNetworkId_ =
DeleteGlobalNetwork'
{ $sel:globalNetworkId:DeleteGlobalNetwork' :: Text
globalNetworkId =
Text
pGlobalNetworkId_
}
deleteGlobalNetwork_globalNetworkId :: Lens.Lens' DeleteGlobalNetwork Prelude.Text
deleteGlobalNetwork_globalNetworkId :: Lens' DeleteGlobalNetwork Text
deleteGlobalNetwork_globalNetworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGlobalNetwork' {Text
globalNetworkId :: Text
$sel:globalNetworkId:DeleteGlobalNetwork' :: DeleteGlobalNetwork -> Text
globalNetworkId} -> Text
globalNetworkId) (\s :: DeleteGlobalNetwork
s@DeleteGlobalNetwork' {} Text
a -> DeleteGlobalNetwork
s {$sel:globalNetworkId:DeleteGlobalNetwork' :: Text
globalNetworkId = Text
a} :: DeleteGlobalNetwork)
instance Core.AWSRequest DeleteGlobalNetwork where
type
AWSResponse DeleteGlobalNetwork =
DeleteGlobalNetworkResponse
request :: (Service -> Service)
-> DeleteGlobalNetwork -> Request DeleteGlobalNetwork
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteGlobalNetwork
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteGlobalNetwork)))
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 GlobalNetwork -> Int -> DeleteGlobalNetworkResponse
DeleteGlobalNetworkResponse'
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
"GlobalNetwork")
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 DeleteGlobalNetwork where
hashWithSalt :: Int -> DeleteGlobalNetwork -> Int
hashWithSalt Int
_salt DeleteGlobalNetwork' {Text
globalNetworkId :: Text
$sel:globalNetworkId:DeleteGlobalNetwork' :: DeleteGlobalNetwork -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
globalNetworkId
instance Prelude.NFData DeleteGlobalNetwork where
rnf :: DeleteGlobalNetwork -> ()
rnf DeleteGlobalNetwork' {Text
globalNetworkId :: Text
$sel:globalNetworkId:DeleteGlobalNetwork' :: DeleteGlobalNetwork -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
globalNetworkId
instance Data.ToHeaders DeleteGlobalNetwork where
toHeaders :: DeleteGlobalNetwork -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DeleteGlobalNetwork where
toPath :: DeleteGlobalNetwork -> ByteString
toPath DeleteGlobalNetwork' {Text
globalNetworkId :: Text
$sel:globalNetworkId:DeleteGlobalNetwork' :: DeleteGlobalNetwork -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/global-networks/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
globalNetworkId]
instance Data.ToQuery DeleteGlobalNetwork where
toQuery :: DeleteGlobalNetwork -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteGlobalNetworkResponse = DeleteGlobalNetworkResponse'
{
DeleteGlobalNetworkResponse -> Maybe GlobalNetwork
globalNetwork :: Prelude.Maybe GlobalNetwork,
DeleteGlobalNetworkResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteGlobalNetworkResponse -> DeleteGlobalNetworkResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGlobalNetworkResponse -> DeleteGlobalNetworkResponse -> Bool
$c/= :: DeleteGlobalNetworkResponse -> DeleteGlobalNetworkResponse -> Bool
== :: DeleteGlobalNetworkResponse -> DeleteGlobalNetworkResponse -> Bool
$c== :: DeleteGlobalNetworkResponse -> DeleteGlobalNetworkResponse -> Bool
Prelude.Eq, ReadPrec [DeleteGlobalNetworkResponse]
ReadPrec DeleteGlobalNetworkResponse
Int -> ReadS DeleteGlobalNetworkResponse
ReadS [DeleteGlobalNetworkResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGlobalNetworkResponse]
$creadListPrec :: ReadPrec [DeleteGlobalNetworkResponse]
readPrec :: ReadPrec DeleteGlobalNetworkResponse
$creadPrec :: ReadPrec DeleteGlobalNetworkResponse
readList :: ReadS [DeleteGlobalNetworkResponse]
$creadList :: ReadS [DeleteGlobalNetworkResponse]
readsPrec :: Int -> ReadS DeleteGlobalNetworkResponse
$creadsPrec :: Int -> ReadS DeleteGlobalNetworkResponse
Prelude.Read, Int -> DeleteGlobalNetworkResponse -> ShowS
[DeleteGlobalNetworkResponse] -> ShowS
DeleteGlobalNetworkResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGlobalNetworkResponse] -> ShowS
$cshowList :: [DeleteGlobalNetworkResponse] -> ShowS
show :: DeleteGlobalNetworkResponse -> String
$cshow :: DeleteGlobalNetworkResponse -> String
showsPrec :: Int -> DeleteGlobalNetworkResponse -> ShowS
$cshowsPrec :: Int -> DeleteGlobalNetworkResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteGlobalNetworkResponse x -> DeleteGlobalNetworkResponse
forall x.
DeleteGlobalNetworkResponse -> Rep DeleteGlobalNetworkResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteGlobalNetworkResponse x -> DeleteGlobalNetworkResponse
$cfrom :: forall x.
DeleteGlobalNetworkResponse -> Rep DeleteGlobalNetworkResponse x
Prelude.Generic)
newDeleteGlobalNetworkResponse ::
Prelude.Int ->
DeleteGlobalNetworkResponse
newDeleteGlobalNetworkResponse :: Int -> DeleteGlobalNetworkResponse
newDeleteGlobalNetworkResponse Int
pHttpStatus_ =
DeleteGlobalNetworkResponse'
{ $sel:globalNetwork:DeleteGlobalNetworkResponse' :: Maybe GlobalNetwork
globalNetwork =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteGlobalNetworkResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteGlobalNetworkResponse_globalNetwork :: Lens.Lens' DeleteGlobalNetworkResponse (Prelude.Maybe GlobalNetwork)
deleteGlobalNetworkResponse_globalNetwork :: Lens' DeleteGlobalNetworkResponse (Maybe GlobalNetwork)
deleteGlobalNetworkResponse_globalNetwork = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGlobalNetworkResponse' {Maybe GlobalNetwork
globalNetwork :: Maybe GlobalNetwork
$sel:globalNetwork:DeleteGlobalNetworkResponse' :: DeleteGlobalNetworkResponse -> Maybe GlobalNetwork
globalNetwork} -> Maybe GlobalNetwork
globalNetwork) (\s :: DeleteGlobalNetworkResponse
s@DeleteGlobalNetworkResponse' {} Maybe GlobalNetwork
a -> DeleteGlobalNetworkResponse
s {$sel:globalNetwork:DeleteGlobalNetworkResponse' :: Maybe GlobalNetwork
globalNetwork = Maybe GlobalNetwork
a} :: DeleteGlobalNetworkResponse)
deleteGlobalNetworkResponse_httpStatus :: Lens.Lens' DeleteGlobalNetworkResponse Prelude.Int
deleteGlobalNetworkResponse_httpStatus :: Lens' DeleteGlobalNetworkResponse Int
deleteGlobalNetworkResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGlobalNetworkResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteGlobalNetworkResponse' :: DeleteGlobalNetworkResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteGlobalNetworkResponse
s@DeleteGlobalNetworkResponse' {} Int
a -> DeleteGlobalNetworkResponse
s {$sel:httpStatus:DeleteGlobalNetworkResponse' :: Int
httpStatus = Int
a} :: DeleteGlobalNetworkResponse)
instance Prelude.NFData DeleteGlobalNetworkResponse where
rnf :: DeleteGlobalNetworkResponse -> ()
rnf DeleteGlobalNetworkResponse' {Int
Maybe GlobalNetwork
httpStatus :: Int
globalNetwork :: Maybe GlobalNetwork
$sel:httpStatus:DeleteGlobalNetworkResponse' :: DeleteGlobalNetworkResponse -> Int
$sel:globalNetwork:DeleteGlobalNetworkResponse' :: DeleteGlobalNetworkResponse -> Maybe GlobalNetwork
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe GlobalNetwork
globalNetwork
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus