{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a documentation part
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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | The string identifier of the associated RestApi.
    DeleteDocumentationPart -> Text
restApiId :: Prelude.Text,
    -- | The identifier of the to-be-deleted documentation part.
    DeleteDocumentationPart -> Text
documentationPartId :: Prelude.Text
  }
  deriving (DeleteDocumentationPart -> DeleteDocumentationPart -> Bool
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]
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
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. 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' - The string identifier of the associated RestApi.
--
-- 'documentationPartId', 'deleteDocumentationPart_documentationPartId' - 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'
      { $sel:restApiId:DeleteDocumentationPart' :: Text
restApiId = Text
pRestApiId_,
        $sel:documentationPartId:DeleteDocumentationPart' :: Text
documentationPartId = Text
pDocumentationPartId_
      }

-- | The string identifier of the associated RestApi.
deleteDocumentationPart_restApiId :: Lens.Lens' DeleteDocumentationPart Prelude.Text
deleteDocumentationPart_restApiId :: Lens' DeleteDocumentationPart Text
deleteDocumentationPart_restApiId = 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)

-- | The identifier of the to-be-deleted documentation part.
deleteDocumentationPart_documentationPartId :: Lens.Lens' DeleteDocumentationPart Prelude.Text
deleteDocumentationPart_documentationPartId :: Lens' DeleteDocumentationPart Text
deleteDocumentationPart_documentationPartId = 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 :: (Service -> Service)
-> DeleteDocumentationPart -> Request DeleteDocumentationPart
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 DeleteDocumentationPart
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteDocumentationPart)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteDocumentationPartResponse
DeleteDocumentationPartResponse'

instance Prelude.Hashable DeleteDocumentationPart where
  hashWithSalt :: Int -> DeleteDocumentationPart -> Int
hashWithSalt Int
_salt DeleteDocumentationPart' {Text
documentationPartId :: Text
restApiId :: Text
$sel:documentationPartId:DeleteDocumentationPart' :: DeleteDocumentationPart -> Text
$sel:restApiId:DeleteDocumentationPart' :: DeleteDocumentationPart -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
restApiId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
documentationPartId

instance Prelude.NFData DeleteDocumentationPart where
  rnf :: DeleteDocumentationPart -> ()
rnf DeleteDocumentationPart' {Text
documentationPartId :: Text
restApiId :: Text
$sel:documentationPartId:DeleteDocumentationPart' :: DeleteDocumentationPart -> Text
$sel:restApiId:DeleteDocumentationPart' :: DeleteDocumentationPart -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
restApiId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
documentationPartId

instance Data.ToHeaders DeleteDocumentationPart where
  toHeaders :: DeleteDocumentationPart -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Data.ToPath DeleteDocumentationPart where
  toPath :: DeleteDocumentationPart -> ByteString
toPath DeleteDocumentationPart' {Text
documentationPartId :: Text
restApiId :: Text
$sel:documentationPartId:DeleteDocumentationPart' :: DeleteDocumentationPart -> Text
$sel:restApiId:DeleteDocumentationPart' :: DeleteDocumentationPart -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/restapis/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
restApiId,
        ByteString
"/documentation/parts/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
documentationPartId
      ]

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

-- | /See:/ 'newDeleteDocumentationPartResponse' smart constructor.
data DeleteDocumentationPartResponse = DeleteDocumentationPartResponse'
  {
  }
  deriving (DeleteDocumentationPartResponse
-> DeleteDocumentationPartResponse -> Bool
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]
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
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.
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
  where
  rnf :: DeleteDocumentationPartResponse -> ()
rnf DeleteDocumentationPartResponse
_ = ()