{-# 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.ApiGatewayV2.DeleteStage
(
DeleteStage (..),
newDeleteStage,
deleteStage_stageName,
deleteStage_apiId,
DeleteStageResponse (..),
newDeleteStageResponse,
)
where
import Amazonka.ApiGatewayV2.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 DeleteStage = DeleteStage'
{
DeleteStage -> Text
stageName :: Prelude.Text,
DeleteStage -> Text
apiId :: Prelude.Text
}
deriving (DeleteStage -> DeleteStage -> Bool
(DeleteStage -> DeleteStage -> Bool)
-> (DeleteStage -> DeleteStage -> Bool) -> Eq DeleteStage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStage -> DeleteStage -> Bool
$c/= :: DeleteStage -> DeleteStage -> Bool
== :: DeleteStage -> DeleteStage -> Bool
$c== :: DeleteStage -> DeleteStage -> Bool
Prelude.Eq, ReadPrec [DeleteStage]
ReadPrec DeleteStage
Int -> ReadS DeleteStage
ReadS [DeleteStage]
(Int -> ReadS DeleteStage)
-> ReadS [DeleteStage]
-> ReadPrec DeleteStage
-> ReadPrec [DeleteStage]
-> Read DeleteStage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStage]
$creadListPrec :: ReadPrec [DeleteStage]
readPrec :: ReadPrec DeleteStage
$creadPrec :: ReadPrec DeleteStage
readList :: ReadS [DeleteStage]
$creadList :: ReadS [DeleteStage]
readsPrec :: Int -> ReadS DeleteStage
$creadsPrec :: Int -> ReadS DeleteStage
Prelude.Read, Int -> DeleteStage -> ShowS
[DeleteStage] -> ShowS
DeleteStage -> String
(Int -> DeleteStage -> ShowS)
-> (DeleteStage -> String)
-> ([DeleteStage] -> ShowS)
-> Show DeleteStage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStage] -> ShowS
$cshowList :: [DeleteStage] -> ShowS
show :: DeleteStage -> String
$cshow :: DeleteStage -> String
showsPrec :: Int -> DeleteStage -> ShowS
$cshowsPrec :: Int -> DeleteStage -> ShowS
Prelude.Show, (forall x. DeleteStage -> Rep DeleteStage x)
-> (forall x. Rep DeleteStage x -> DeleteStage)
-> Generic DeleteStage
forall x. Rep DeleteStage x -> DeleteStage
forall x. DeleteStage -> Rep DeleteStage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteStage x -> DeleteStage
$cfrom :: forall x. DeleteStage -> Rep DeleteStage x
Prelude.Generic)
newDeleteStage ::
Prelude.Text ->
Prelude.Text ->
DeleteStage
newDeleteStage :: Text -> Text -> DeleteStage
newDeleteStage Text
pStageName_ Text
pApiId_ =
DeleteStage' :: Text -> Text -> DeleteStage
DeleteStage'
{ $sel:stageName:DeleteStage' :: Text
stageName = Text
pStageName_,
$sel:apiId:DeleteStage' :: Text
apiId = Text
pApiId_
}
deleteStage_stageName :: Lens.Lens' DeleteStage Prelude.Text
deleteStage_stageName :: (Text -> f Text) -> DeleteStage -> f DeleteStage
deleteStage_stageName = (DeleteStage -> Text)
-> (DeleteStage -> Text -> DeleteStage)
-> Lens DeleteStage DeleteStage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStage' {Text
stageName :: Text
$sel:stageName:DeleteStage' :: DeleteStage -> Text
stageName} -> Text
stageName) (\s :: DeleteStage
s@DeleteStage' {} Text
a -> DeleteStage
s {$sel:stageName:DeleteStage' :: Text
stageName = Text
a} :: DeleteStage)
deleteStage_apiId :: Lens.Lens' DeleteStage Prelude.Text
deleteStage_apiId :: (Text -> f Text) -> DeleteStage -> f DeleteStage
deleteStage_apiId = (DeleteStage -> Text)
-> (DeleteStage -> Text -> DeleteStage)
-> Lens DeleteStage DeleteStage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStage' {Text
apiId :: Text
$sel:apiId:DeleteStage' :: DeleteStage -> Text
apiId} -> Text
apiId) (\s :: DeleteStage
s@DeleteStage' {} Text
a -> DeleteStage
s {$sel:apiId:DeleteStage' :: Text
apiId = Text
a} :: DeleteStage)
instance Core.AWSRequest DeleteStage where
type AWSResponse DeleteStage = DeleteStageResponse
request :: DeleteStage -> Request DeleteStage
request = Service -> DeleteStage -> Request DeleteStage
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteStage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteStage)))
response = AWSResponse DeleteStage
-> Logger
-> Service
-> Proxy DeleteStage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteStage)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteStage
DeleteStageResponse
DeleteStageResponse'
instance Prelude.Hashable DeleteStage
instance Prelude.NFData DeleteStage
instance Core.ToHeaders DeleteStage where
toHeaders :: DeleteStage -> [Header]
toHeaders =
[Header] -> DeleteStage -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DeleteStage where
toPath :: DeleteStage -> ByteString
toPath DeleteStage' {Text
apiId :: Text
stageName :: Text
$sel:apiId:DeleteStage' :: DeleteStage -> Text
$sel:stageName:DeleteStage' :: DeleteStage -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v2/apis/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId,
ByteString
"/stages/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
stageName
]
instance Core.ToQuery DeleteStage where
toQuery :: DeleteStage -> QueryString
toQuery = QueryString -> DeleteStage -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteStageResponse = DeleteStageResponse'
{
}
deriving (DeleteStageResponse -> DeleteStageResponse -> Bool
(DeleteStageResponse -> DeleteStageResponse -> Bool)
-> (DeleteStageResponse -> DeleteStageResponse -> Bool)
-> Eq DeleteStageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStageResponse -> DeleteStageResponse -> Bool
$c/= :: DeleteStageResponse -> DeleteStageResponse -> Bool
== :: DeleteStageResponse -> DeleteStageResponse -> Bool
$c== :: DeleteStageResponse -> DeleteStageResponse -> Bool
Prelude.Eq, ReadPrec [DeleteStageResponse]
ReadPrec DeleteStageResponse
Int -> ReadS DeleteStageResponse
ReadS [DeleteStageResponse]
(Int -> ReadS DeleteStageResponse)
-> ReadS [DeleteStageResponse]
-> ReadPrec DeleteStageResponse
-> ReadPrec [DeleteStageResponse]
-> Read DeleteStageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStageResponse]
$creadListPrec :: ReadPrec [DeleteStageResponse]
readPrec :: ReadPrec DeleteStageResponse
$creadPrec :: ReadPrec DeleteStageResponse
readList :: ReadS [DeleteStageResponse]
$creadList :: ReadS [DeleteStageResponse]
readsPrec :: Int -> ReadS DeleteStageResponse
$creadsPrec :: Int -> ReadS DeleteStageResponse
Prelude.Read, Int -> DeleteStageResponse -> ShowS
[DeleteStageResponse] -> ShowS
DeleteStageResponse -> String
(Int -> DeleteStageResponse -> ShowS)
-> (DeleteStageResponse -> String)
-> ([DeleteStageResponse] -> ShowS)
-> Show DeleteStageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStageResponse] -> ShowS
$cshowList :: [DeleteStageResponse] -> ShowS
show :: DeleteStageResponse -> String
$cshow :: DeleteStageResponse -> String
showsPrec :: Int -> DeleteStageResponse -> ShowS
$cshowsPrec :: Int -> DeleteStageResponse -> ShowS
Prelude.Show, (forall x. DeleteStageResponse -> Rep DeleteStageResponse x)
-> (forall x. Rep DeleteStageResponse x -> DeleteStageResponse)
-> Generic DeleteStageResponse
forall x. Rep DeleteStageResponse x -> DeleteStageResponse
forall x. DeleteStageResponse -> Rep DeleteStageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteStageResponse x -> DeleteStageResponse
$cfrom :: forall x. DeleteStageResponse -> Rep DeleteStageResponse x
Prelude.Generic)
newDeleteStageResponse ::
DeleteStageResponse
newDeleteStageResponse :: DeleteStageResponse
newDeleteStageResponse = DeleteStageResponse
DeleteStageResponse'
instance Prelude.NFData DeleteStageResponse