{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.APIGateway.DeleteDocumentationPart
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- -- | Undocumented operation.
module Amazonka.APIGateway.DeleteDocumentationPart
  ( -- * Creating a Request
    DeleteDocumentationPart (..),
    newDeleteDocumentationPart,

    -- * Request Lenses
    deleteDocumentationPart_restApiId,
    deleteDocumentationPart_documentationPartId,

    -- * Destructuring the Response
    DeleteDocumentationPartResponse (..),
    newDeleteDocumentationPartResponse,
  )
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

-- | Deletes an existing documentation part of an API.
--
-- /See:/ 'newDeleteDocumentationPart' smart constructor.
data DeleteDocumentationPart = DeleteDocumentationPart'
  { -- | [Required] The string identifier of the associated RestApi.
    DeleteDocumentationPart -> Text
restApiId :: Prelude.Text,
    -- | [Required] The identifier of the to-be-deleted documentation part.
    DeleteDocumentationPart -> Text
documentationPartId :: Prelude.Text
  }
  deriving (DeleteDocumentationPart -> DeleteDocumentationPart -> Bool
(DeleteDocumentationPart -> DeleteDocumentationPart -> Bool)
-> (DeleteDocumentationPart -> DeleteDocumentationPart -> Bool)
-> Eq DeleteDocumentationPart
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDocumentationPart -> DeleteDocumentationPart -> Bool
$c/= :: DeleteDocumentationPart -> DeleteDocumentationPart -> Bool
== :: DeleteDocumentationPart -> DeleteDocumentationPart -> Bool
$c== :: DeleteDocumentationPart -> DeleteDocumentationPart -> Bool
Prelude.Eq, ReadPrec [DeleteDocumentationPart]
ReadPrec DeleteDocumentationPart
Int -> ReadS DeleteDocumentationPart
ReadS [DeleteDocumentationPart]
(Int -> ReadS DeleteDocumentationPart)
-> ReadS [DeleteDocumentationPart]
-> ReadPrec DeleteDocumentationPart
-> ReadPrec [DeleteDocumentationPart]
-> Read DeleteDocumentationPart
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDocumentationPart]
$creadListPrec :: ReadPrec [DeleteDocumentationPart]
readPrec :: ReadPrec DeleteDocumentationPart
$creadPrec :: ReadPrec DeleteDocumentationPart
readList :: ReadS [DeleteDocumentationPart]
$creadList :: ReadS [DeleteDocumentationPart]
readsPrec :: Int -> ReadS DeleteDocumentationPart
$creadsPrec :: Int -> ReadS DeleteDocumentationPart
Prelude.Read, Int -> DeleteDocumentationPart -> ShowS
[DeleteDocumentationPart] -> ShowS
DeleteDocumentationPart -> String
(Int -> DeleteDocumentationPart -> ShowS)
-> (DeleteDocumentationPart -> String)
-> ([DeleteDocumentationPart] -> ShowS)
-> Show DeleteDocumentationPart
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDocumentationPart] -> ShowS
$cshowList :: [DeleteDocumentationPart] -> ShowS
show :: DeleteDocumentationPart -> String
$cshow :: DeleteDocumentationPart -> String
showsPrec :: Int -> DeleteDocumentationPart -> ShowS
$cshowsPrec :: Int -> DeleteDocumentationPart -> ShowS
Prelude.Show, (forall x.
 DeleteDocumentationPart -> Rep DeleteDocumentationPart x)
-> (forall x.
    Rep DeleteDocumentationPart x -> DeleteDocumentationPart)
-> Generic DeleteDocumentationPart
forall x. Rep DeleteDocumentationPart x -> DeleteDocumentationPart
forall x. DeleteDocumentationPart -> Rep DeleteDocumentationPart x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDocumentationPart x -> DeleteDocumentationPart
$cfrom :: forall x. DeleteDocumentationPart -> Rep DeleteDocumentationPart x
Prelude.Generic)

-- |
-- Create a value of 'DeleteDocumentationPart' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'restApiId', 'deleteDocumentationPart_restApiId' - [Required] The string identifier of the associated RestApi.
--
-- 'documentationPartId', 'deleteDocumentationPart_documentationPartId' - [Required] The identifier of the to-be-deleted documentation part.
newDeleteDocumentationPart ::
  -- | 'restApiId'
  Prelude.Text ->
  -- | 'documentationPartId'
  Prelude.Text ->
  DeleteDocumentationPart
newDeleteDocumentationPart :: Text -> Text -> DeleteDocumentationPart
newDeleteDocumentationPart
  Text
pRestApiId_
  Text
pDocumentationPartId_ =
    DeleteDocumentationPart' :: Text -> Text -> DeleteDocumentationPart
DeleteDocumentationPart'
      { $sel:restApiId:DeleteDocumentationPart' :: Text
restApiId = Text
pRestApiId_,
        $sel:documentationPartId:DeleteDocumentationPart' :: Text
documentationPartId = Text
pDocumentationPartId_
      }

-- | [Required] The string identifier of the associated RestApi.
deleteDocumentationPart_restApiId :: Lens.Lens' DeleteDocumentationPart Prelude.Text
deleteDocumentationPart_restApiId :: (Text -> f Text)
-> DeleteDocumentationPart -> f DeleteDocumentationPart
deleteDocumentationPart_restApiId = (DeleteDocumentationPart -> Text)
-> (DeleteDocumentationPart -> Text -> DeleteDocumentationPart)
-> Lens DeleteDocumentationPart DeleteDocumentationPart Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDocumentationPart' {Text
restApiId :: Text
$sel:restApiId:DeleteDocumentationPart' :: DeleteDocumentationPart -> Text
restApiId} -> Text
restApiId) (\s :: DeleteDocumentationPart
s@DeleteDocumentationPart' {} Text
a -> DeleteDocumentationPart
s {$sel:restApiId:DeleteDocumentationPart' :: Text
restApiId = Text
a} :: DeleteDocumentationPart)

-- | [Required] The identifier of the to-be-deleted documentation part.
deleteDocumentationPart_documentationPartId :: Lens.Lens' DeleteDocumentationPart Prelude.Text
deleteDocumentationPart_documentationPartId :: (Text -> f Text)
-> DeleteDocumentationPart -> f DeleteDocumentationPart
deleteDocumentationPart_documentationPartId = (DeleteDocumentationPart -> Text)
-> (DeleteDocumentationPart -> Text -> DeleteDocumentationPart)
-> Lens DeleteDocumentationPart DeleteDocumentationPart Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDocumentationPart' {Text
documentationPartId :: Text
$sel:documentationPartId:DeleteDocumentationPart' :: DeleteDocumentationPart -> Text
documentationPartId} -> Text
documentationPartId) (\s :: DeleteDocumentationPart
s@DeleteDocumentationPart' {} Text
a -> DeleteDocumentationPart
s {$sel:documentationPartId:DeleteDocumentationPart' :: Text
documentationPartId = Text
a} :: DeleteDocumentationPart)

instance Core.AWSRequest DeleteDocumentationPart where
  type
    AWSResponse DeleteDocumentationPart =
      DeleteDocumentationPartResponse
  request :: DeleteDocumentationPart -> Request DeleteDocumentationPart
request = Service
-> DeleteDocumentationPart -> Request DeleteDocumentationPart
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteDocumentationPart
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteDocumentationPart)))
response =
    AWSResponse DeleteDocumentationPart
-> Logger
-> Service
-> Proxy DeleteDocumentationPart
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteDocumentationPart)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteDocumentationPart
DeleteDocumentationPartResponse
DeleteDocumentationPartResponse'

instance Prelude.Hashable DeleteDocumentationPart

instance Prelude.NFData DeleteDocumentationPart

instance Core.ToHeaders DeleteDocumentationPart where
  toHeaders :: DeleteDocumentationPart -> [Header]
toHeaders =
    [Header] -> DeleteDocumentationPart -> [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 DeleteDocumentationPart where
  toPath :: DeleteDocumentationPart -> ByteString
toPath DeleteDocumentationPart' {Text
documentationPartId :: Text
restApiId :: Text
$sel:documentationPartId:DeleteDocumentationPart' :: DeleteDocumentationPart -> Text
$sel:restApiId:DeleteDocumentationPart' :: DeleteDocumentationPart -> 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,
        ByteString
"/documentation/parts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
documentationPartId
      ]

instance Core.ToQuery DeleteDocumentationPart where
  toQuery :: DeleteDocumentationPart -> QueryString
toQuery = QueryString -> DeleteDocumentationPart -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDeleteDocumentationPartResponse' smart constructor.
data DeleteDocumentationPartResponse = DeleteDocumentationPartResponse'
  {
  }
  deriving (DeleteDocumentationPartResponse
-> DeleteDocumentationPartResponse -> Bool
(DeleteDocumentationPartResponse
 -> DeleteDocumentationPartResponse -> Bool)
-> (DeleteDocumentationPartResponse
    -> DeleteDocumentationPartResponse -> Bool)
-> Eq DeleteDocumentationPartResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDocumentationPartResponse
-> DeleteDocumentationPartResponse -> Bool
$c/= :: DeleteDocumentationPartResponse
-> DeleteDocumentationPartResponse -> Bool
== :: DeleteDocumentationPartResponse
-> DeleteDocumentationPartResponse -> Bool
$c== :: DeleteDocumentationPartResponse
-> DeleteDocumentationPartResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDocumentationPartResponse]
ReadPrec DeleteDocumentationPartResponse
Int -> ReadS DeleteDocumentationPartResponse
ReadS [DeleteDocumentationPartResponse]
(Int -> ReadS DeleteDocumentationPartResponse)
-> ReadS [DeleteDocumentationPartResponse]
-> ReadPrec DeleteDocumentationPartResponse
-> ReadPrec [DeleteDocumentationPartResponse]
-> Read DeleteDocumentationPartResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDocumentationPartResponse]
$creadListPrec :: ReadPrec [DeleteDocumentationPartResponse]
readPrec :: ReadPrec DeleteDocumentationPartResponse
$creadPrec :: ReadPrec DeleteDocumentationPartResponse
readList :: ReadS [DeleteDocumentationPartResponse]
$creadList :: ReadS [DeleteDocumentationPartResponse]
readsPrec :: Int -> ReadS DeleteDocumentationPartResponse
$creadsPrec :: Int -> ReadS DeleteDocumentationPartResponse
Prelude.Read, Int -> DeleteDocumentationPartResponse -> ShowS
[DeleteDocumentationPartResponse] -> ShowS
DeleteDocumentationPartResponse -> String
(Int -> DeleteDocumentationPartResponse -> ShowS)
-> (DeleteDocumentationPartResponse -> String)
-> ([DeleteDocumentationPartResponse] -> ShowS)
-> Show DeleteDocumentationPartResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDocumentationPartResponse] -> ShowS
$cshowList :: [DeleteDocumentationPartResponse] -> ShowS
show :: DeleteDocumentationPartResponse -> String
$cshow :: DeleteDocumentationPartResponse -> String
showsPrec :: Int -> DeleteDocumentationPartResponse -> ShowS
$cshowsPrec :: Int -> DeleteDocumentationPartResponse -> ShowS
Prelude.Show, (forall x.
 DeleteDocumentationPartResponse
 -> Rep DeleteDocumentationPartResponse x)
-> (forall x.
    Rep DeleteDocumentationPartResponse x
    -> DeleteDocumentationPartResponse)
-> Generic DeleteDocumentationPartResponse
forall x.
Rep DeleteDocumentationPartResponse x
-> DeleteDocumentationPartResponse
forall x.
DeleteDocumentationPartResponse
-> Rep DeleteDocumentationPartResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDocumentationPartResponse x
-> DeleteDocumentationPartResponse
$cfrom :: forall x.
DeleteDocumentationPartResponse
-> Rep DeleteDocumentationPartResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteDocumentationPartResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
newDeleteDocumentationPartResponse ::
  DeleteDocumentationPartResponse
newDeleteDocumentationPartResponse :: DeleteDocumentationPartResponse
newDeleteDocumentationPartResponse =
  DeleteDocumentationPartResponse
DeleteDocumentationPartResponse'

instance
  Prelude.NFData
    DeleteDocumentationPartResponse