{-# 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.APIGateway.DeleteRestApi
(
DeleteRestApi (..),
newDeleteRestApi,
deleteRestApi_restApiId,
DeleteRestApiResponse (..),
newDeleteRestApiResponse,
)
where
import Amazonka.APIGateway.Types
import qualified Amazonka.Core as Core
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 DeleteRestApi = DeleteRestApi'
{
DeleteRestApi -> Text
restApiId :: Prelude.Text
}
deriving (DeleteRestApi -> DeleteRestApi -> Bool
(DeleteRestApi -> DeleteRestApi -> Bool)
-> (DeleteRestApi -> DeleteRestApi -> Bool) -> Eq DeleteRestApi
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRestApi -> DeleteRestApi -> Bool
$c/= :: DeleteRestApi -> DeleteRestApi -> Bool
== :: DeleteRestApi -> DeleteRestApi -> Bool
$c== :: DeleteRestApi -> DeleteRestApi -> Bool
Prelude.Eq, ReadPrec [DeleteRestApi]
ReadPrec DeleteRestApi
Int -> ReadS DeleteRestApi
ReadS [DeleteRestApi]
(Int -> ReadS DeleteRestApi)
-> ReadS [DeleteRestApi]
-> ReadPrec DeleteRestApi
-> ReadPrec [DeleteRestApi]
-> Read DeleteRestApi
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRestApi]
$creadListPrec :: ReadPrec [DeleteRestApi]
readPrec :: ReadPrec DeleteRestApi
$creadPrec :: ReadPrec DeleteRestApi
readList :: ReadS [DeleteRestApi]
$creadList :: ReadS [DeleteRestApi]
readsPrec :: Int -> ReadS DeleteRestApi
$creadsPrec :: Int -> ReadS DeleteRestApi
Prelude.Read, Int -> DeleteRestApi -> ShowS
[DeleteRestApi] -> ShowS
DeleteRestApi -> String
(Int -> DeleteRestApi -> ShowS)
-> (DeleteRestApi -> String)
-> ([DeleteRestApi] -> ShowS)
-> Show DeleteRestApi
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRestApi] -> ShowS
$cshowList :: [DeleteRestApi] -> ShowS
show :: DeleteRestApi -> String
$cshow :: DeleteRestApi -> String
showsPrec :: Int -> DeleteRestApi -> ShowS
$cshowsPrec :: Int -> DeleteRestApi -> ShowS
Prelude.Show, (forall x. DeleteRestApi -> Rep DeleteRestApi x)
-> (forall x. Rep DeleteRestApi x -> DeleteRestApi)
-> Generic DeleteRestApi
forall x. Rep DeleteRestApi x -> DeleteRestApi
forall x. DeleteRestApi -> Rep DeleteRestApi x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRestApi x -> DeleteRestApi
$cfrom :: forall x. DeleteRestApi -> Rep DeleteRestApi x
Prelude.Generic)
newDeleteRestApi ::
Prelude.Text ->
DeleteRestApi
newDeleteRestApi :: Text -> DeleteRestApi
newDeleteRestApi Text
pRestApiId_ =
DeleteRestApi' :: Text -> DeleteRestApi
DeleteRestApi' {$sel:restApiId:DeleteRestApi' :: Text
restApiId = Text
pRestApiId_}
deleteRestApi_restApiId :: Lens.Lens' DeleteRestApi Prelude.Text
deleteRestApi_restApiId :: (Text -> f Text) -> DeleteRestApi -> f DeleteRestApi
deleteRestApi_restApiId = (DeleteRestApi -> Text)
-> (DeleteRestApi -> Text -> DeleteRestApi)
-> Lens DeleteRestApi DeleteRestApi Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRestApi' {Text
restApiId :: Text
$sel:restApiId:DeleteRestApi' :: DeleteRestApi -> Text
restApiId} -> Text
restApiId) (\s :: DeleteRestApi
s@DeleteRestApi' {} Text
a -> DeleteRestApi
s {$sel:restApiId:DeleteRestApi' :: Text
restApiId = Text
a} :: DeleteRestApi)
instance Core.AWSRequest DeleteRestApi where
type
AWSResponse DeleteRestApi =
DeleteRestApiResponse
request :: DeleteRestApi -> Request DeleteRestApi
request = Service -> DeleteRestApi -> Request DeleteRestApi
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteRestApi
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteRestApi)))
response =
AWSResponse DeleteRestApi
-> Logger
-> Service
-> Proxy DeleteRestApi
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteRestApi)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteRestApi
DeleteRestApiResponse
DeleteRestApiResponse'
instance Prelude.Hashable DeleteRestApi
instance Prelude.NFData DeleteRestApi
instance Core.ToHeaders DeleteRestApi where
toHeaders :: DeleteRestApi -> [Header]
toHeaders =
[Header] -> DeleteRestApi -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Accept"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
]
)
instance Core.ToPath DeleteRestApi where
toPath :: DeleteRestApi -> ByteString
toPath DeleteRestApi' {Text
restApiId :: Text
$sel:restApiId:DeleteRestApi' :: DeleteRestApi -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/restapis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId]
instance Core.ToQuery DeleteRestApi where
toQuery :: DeleteRestApi -> QueryString
toQuery = QueryString -> DeleteRestApi -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteRestApiResponse = DeleteRestApiResponse'
{
}
deriving (DeleteRestApiResponse -> DeleteRestApiResponse -> Bool
(DeleteRestApiResponse -> DeleteRestApiResponse -> Bool)
-> (DeleteRestApiResponse -> DeleteRestApiResponse -> Bool)
-> Eq DeleteRestApiResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRestApiResponse -> DeleteRestApiResponse -> Bool
$c/= :: DeleteRestApiResponse -> DeleteRestApiResponse -> Bool
== :: DeleteRestApiResponse -> DeleteRestApiResponse -> Bool
$c== :: DeleteRestApiResponse -> DeleteRestApiResponse -> Bool
Prelude.Eq, ReadPrec [DeleteRestApiResponse]
ReadPrec DeleteRestApiResponse
Int -> ReadS DeleteRestApiResponse
ReadS [DeleteRestApiResponse]
(Int -> ReadS DeleteRestApiResponse)
-> ReadS [DeleteRestApiResponse]
-> ReadPrec DeleteRestApiResponse
-> ReadPrec [DeleteRestApiResponse]
-> Read DeleteRestApiResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRestApiResponse]
$creadListPrec :: ReadPrec [DeleteRestApiResponse]
readPrec :: ReadPrec DeleteRestApiResponse
$creadPrec :: ReadPrec DeleteRestApiResponse
readList :: ReadS [DeleteRestApiResponse]
$creadList :: ReadS [DeleteRestApiResponse]
readsPrec :: Int -> ReadS DeleteRestApiResponse
$creadsPrec :: Int -> ReadS DeleteRestApiResponse
Prelude.Read, Int -> DeleteRestApiResponse -> ShowS
[DeleteRestApiResponse] -> ShowS
DeleteRestApiResponse -> String
(Int -> DeleteRestApiResponse -> ShowS)
-> (DeleteRestApiResponse -> String)
-> ([DeleteRestApiResponse] -> ShowS)
-> Show DeleteRestApiResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRestApiResponse] -> ShowS
$cshowList :: [DeleteRestApiResponse] -> ShowS
show :: DeleteRestApiResponse -> String
$cshow :: DeleteRestApiResponse -> String
showsPrec :: Int -> DeleteRestApiResponse -> ShowS
$cshowsPrec :: Int -> DeleteRestApiResponse -> ShowS
Prelude.Show, (forall x. DeleteRestApiResponse -> Rep DeleteRestApiResponse x)
-> (forall x. Rep DeleteRestApiResponse x -> DeleteRestApiResponse)
-> Generic DeleteRestApiResponse
forall x. Rep DeleteRestApiResponse x -> DeleteRestApiResponse
forall x. DeleteRestApiResponse -> Rep DeleteRestApiResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRestApiResponse x -> DeleteRestApiResponse
$cfrom :: forall x. DeleteRestApiResponse -> Rep DeleteRestApiResponse x
Prelude.Generic)
newDeleteRestApiResponse ::
DeleteRestApiResponse
newDeleteRestApiResponse :: DeleteRestApiResponse
newDeleteRestApiResponse = DeleteRestApiResponse
DeleteRestApiResponse'
instance Prelude.NFData DeleteRestApiResponse