{-# 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.DeleteCoreNetwork
(
DeleteCoreNetwork (..),
newDeleteCoreNetwork,
deleteCoreNetwork_coreNetworkId,
DeleteCoreNetworkResponse (..),
newDeleteCoreNetworkResponse,
deleteCoreNetworkResponse_coreNetwork,
deleteCoreNetworkResponse_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 DeleteCoreNetwork = DeleteCoreNetwork'
{
DeleteCoreNetwork -> Text
coreNetworkId :: Prelude.Text
}
deriving (DeleteCoreNetwork -> DeleteCoreNetwork -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCoreNetwork -> DeleteCoreNetwork -> Bool
$c/= :: DeleteCoreNetwork -> DeleteCoreNetwork -> Bool
== :: DeleteCoreNetwork -> DeleteCoreNetwork -> Bool
$c== :: DeleteCoreNetwork -> DeleteCoreNetwork -> Bool
Prelude.Eq, ReadPrec [DeleteCoreNetwork]
ReadPrec DeleteCoreNetwork
Int -> ReadS DeleteCoreNetwork
ReadS [DeleteCoreNetwork]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCoreNetwork]
$creadListPrec :: ReadPrec [DeleteCoreNetwork]
readPrec :: ReadPrec DeleteCoreNetwork
$creadPrec :: ReadPrec DeleteCoreNetwork
readList :: ReadS [DeleteCoreNetwork]
$creadList :: ReadS [DeleteCoreNetwork]
readsPrec :: Int -> ReadS DeleteCoreNetwork
$creadsPrec :: Int -> ReadS DeleteCoreNetwork
Prelude.Read, Int -> DeleteCoreNetwork -> ShowS
[DeleteCoreNetwork] -> ShowS
DeleteCoreNetwork -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCoreNetwork] -> ShowS
$cshowList :: [DeleteCoreNetwork] -> ShowS
show :: DeleteCoreNetwork -> String
$cshow :: DeleteCoreNetwork -> String
showsPrec :: Int -> DeleteCoreNetwork -> ShowS
$cshowsPrec :: Int -> DeleteCoreNetwork -> ShowS
Prelude.Show, forall x. Rep DeleteCoreNetwork x -> DeleteCoreNetwork
forall x. DeleteCoreNetwork -> Rep DeleteCoreNetwork x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCoreNetwork x -> DeleteCoreNetwork
$cfrom :: forall x. DeleteCoreNetwork -> Rep DeleteCoreNetwork x
Prelude.Generic)
newDeleteCoreNetwork ::
Prelude.Text ->
DeleteCoreNetwork
newDeleteCoreNetwork :: Text -> DeleteCoreNetwork
newDeleteCoreNetwork Text
pCoreNetworkId_ =
DeleteCoreNetwork' {$sel:coreNetworkId:DeleteCoreNetwork' :: Text
coreNetworkId = Text
pCoreNetworkId_}
deleteCoreNetwork_coreNetworkId :: Lens.Lens' DeleteCoreNetwork Prelude.Text
deleteCoreNetwork_coreNetworkId :: Lens' DeleteCoreNetwork Text
deleteCoreNetwork_coreNetworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCoreNetwork' {Text
coreNetworkId :: Text
$sel:coreNetworkId:DeleteCoreNetwork' :: DeleteCoreNetwork -> Text
coreNetworkId} -> Text
coreNetworkId) (\s :: DeleteCoreNetwork
s@DeleteCoreNetwork' {} Text
a -> DeleteCoreNetwork
s {$sel:coreNetworkId:DeleteCoreNetwork' :: Text
coreNetworkId = Text
a} :: DeleteCoreNetwork)
instance Core.AWSRequest DeleteCoreNetwork where
type
AWSResponse DeleteCoreNetwork =
DeleteCoreNetworkResponse
request :: (Service -> Service)
-> DeleteCoreNetwork -> Request DeleteCoreNetwork
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 DeleteCoreNetwork
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCoreNetwork)))
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 CoreNetwork -> Int -> DeleteCoreNetworkResponse
DeleteCoreNetworkResponse'
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
"CoreNetwork")
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 DeleteCoreNetwork where
hashWithSalt :: Int -> DeleteCoreNetwork -> Int
hashWithSalt Int
_salt DeleteCoreNetwork' {Text
coreNetworkId :: Text
$sel:coreNetworkId:DeleteCoreNetwork' :: DeleteCoreNetwork -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
coreNetworkId
instance Prelude.NFData DeleteCoreNetwork where
rnf :: DeleteCoreNetwork -> ()
rnf DeleteCoreNetwork' {Text
coreNetworkId :: Text
$sel:coreNetworkId:DeleteCoreNetwork' :: DeleteCoreNetwork -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
coreNetworkId
instance Data.ToHeaders DeleteCoreNetwork where
toHeaders :: DeleteCoreNetwork -> 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 DeleteCoreNetwork where
toPath :: DeleteCoreNetwork -> ByteString
toPath DeleteCoreNetwork' {Text
coreNetworkId :: Text
$sel:coreNetworkId:DeleteCoreNetwork' :: DeleteCoreNetwork -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/core-networks/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
coreNetworkId]
instance Data.ToQuery DeleteCoreNetwork where
toQuery :: DeleteCoreNetwork -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteCoreNetworkResponse = DeleteCoreNetworkResponse'
{
DeleteCoreNetworkResponse -> Maybe CoreNetwork
coreNetwork :: Prelude.Maybe CoreNetwork,
DeleteCoreNetworkResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteCoreNetworkResponse -> DeleteCoreNetworkResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCoreNetworkResponse -> DeleteCoreNetworkResponse -> Bool
$c/= :: DeleteCoreNetworkResponse -> DeleteCoreNetworkResponse -> Bool
== :: DeleteCoreNetworkResponse -> DeleteCoreNetworkResponse -> Bool
$c== :: DeleteCoreNetworkResponse -> DeleteCoreNetworkResponse -> Bool
Prelude.Eq, ReadPrec [DeleteCoreNetworkResponse]
ReadPrec DeleteCoreNetworkResponse
Int -> ReadS DeleteCoreNetworkResponse
ReadS [DeleteCoreNetworkResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCoreNetworkResponse]
$creadListPrec :: ReadPrec [DeleteCoreNetworkResponse]
readPrec :: ReadPrec DeleteCoreNetworkResponse
$creadPrec :: ReadPrec DeleteCoreNetworkResponse
readList :: ReadS [DeleteCoreNetworkResponse]
$creadList :: ReadS [DeleteCoreNetworkResponse]
readsPrec :: Int -> ReadS DeleteCoreNetworkResponse
$creadsPrec :: Int -> ReadS DeleteCoreNetworkResponse
Prelude.Read, Int -> DeleteCoreNetworkResponse -> ShowS
[DeleteCoreNetworkResponse] -> ShowS
DeleteCoreNetworkResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCoreNetworkResponse] -> ShowS
$cshowList :: [DeleteCoreNetworkResponse] -> ShowS
show :: DeleteCoreNetworkResponse -> String
$cshow :: DeleteCoreNetworkResponse -> String
showsPrec :: Int -> DeleteCoreNetworkResponse -> ShowS
$cshowsPrec :: Int -> DeleteCoreNetworkResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteCoreNetworkResponse x -> DeleteCoreNetworkResponse
forall x.
DeleteCoreNetworkResponse -> Rep DeleteCoreNetworkResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCoreNetworkResponse x -> DeleteCoreNetworkResponse
$cfrom :: forall x.
DeleteCoreNetworkResponse -> Rep DeleteCoreNetworkResponse x
Prelude.Generic)
newDeleteCoreNetworkResponse ::
Prelude.Int ->
DeleteCoreNetworkResponse
newDeleteCoreNetworkResponse :: Int -> DeleteCoreNetworkResponse
newDeleteCoreNetworkResponse Int
pHttpStatus_ =
DeleteCoreNetworkResponse'
{ $sel:coreNetwork:DeleteCoreNetworkResponse' :: Maybe CoreNetwork
coreNetwork =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteCoreNetworkResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteCoreNetworkResponse_coreNetwork :: Lens.Lens' DeleteCoreNetworkResponse (Prelude.Maybe CoreNetwork)
deleteCoreNetworkResponse_coreNetwork :: Lens' DeleteCoreNetworkResponse (Maybe CoreNetwork)
deleteCoreNetworkResponse_coreNetwork = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCoreNetworkResponse' {Maybe CoreNetwork
coreNetwork :: Maybe CoreNetwork
$sel:coreNetwork:DeleteCoreNetworkResponse' :: DeleteCoreNetworkResponse -> Maybe CoreNetwork
coreNetwork} -> Maybe CoreNetwork
coreNetwork) (\s :: DeleteCoreNetworkResponse
s@DeleteCoreNetworkResponse' {} Maybe CoreNetwork
a -> DeleteCoreNetworkResponse
s {$sel:coreNetwork:DeleteCoreNetworkResponse' :: Maybe CoreNetwork
coreNetwork = Maybe CoreNetwork
a} :: DeleteCoreNetworkResponse)
deleteCoreNetworkResponse_httpStatus :: Lens.Lens' DeleteCoreNetworkResponse Prelude.Int
deleteCoreNetworkResponse_httpStatus :: Lens' DeleteCoreNetworkResponse Int
deleteCoreNetworkResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCoreNetworkResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCoreNetworkResponse' :: DeleteCoreNetworkResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteCoreNetworkResponse
s@DeleteCoreNetworkResponse' {} Int
a -> DeleteCoreNetworkResponse
s {$sel:httpStatus:DeleteCoreNetworkResponse' :: Int
httpStatus = Int
a} :: DeleteCoreNetworkResponse)
instance Prelude.NFData DeleteCoreNetworkResponse where
rnf :: DeleteCoreNetworkResponse -> ()
rnf DeleteCoreNetworkResponse' {Int
Maybe CoreNetwork
httpStatus :: Int
coreNetwork :: Maybe CoreNetwork
$sel:httpStatus:DeleteCoreNetworkResponse' :: DeleteCoreNetworkResponse -> Int
$sel:coreNetwork:DeleteCoreNetworkResponse' :: DeleteCoreNetworkResponse -> Maybe CoreNetwork
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CoreNetwork
coreNetwork
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus