{-# 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.Athena.DeleteNotebook
-- 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 the specified notebook.
module Amazonka.Athena.DeleteNotebook
  ( -- * Creating a Request
    DeleteNotebook (..),
    newDeleteNotebook,

    -- * Request Lenses
    deleteNotebook_notebookId,

    -- * Destructuring the Response
    DeleteNotebookResponse (..),
    newDeleteNotebookResponse,

    -- * Response Lenses
    deleteNotebookResponse_httpStatus,
  )
where

import Amazonka.Athena.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

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

-- |
-- Create a value of 'DeleteNotebook' 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:
--
-- 'notebookId', 'deleteNotebook_notebookId' - The ID of the notebook to delete.
newDeleteNotebook ::
  -- | 'notebookId'
  Prelude.Text ->
  DeleteNotebook
newDeleteNotebook :: Text -> DeleteNotebook
newDeleteNotebook Text
pNotebookId_ =
  DeleteNotebook' {$sel:notebookId:DeleteNotebook' :: Text
notebookId = Text
pNotebookId_}

-- | The ID of the notebook to delete.
deleteNotebook_notebookId :: Lens.Lens' DeleteNotebook Prelude.Text
deleteNotebook_notebookId :: Lens' DeleteNotebook Text
deleteNotebook_notebookId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNotebook' {Text
notebookId :: Text
$sel:notebookId:DeleteNotebook' :: DeleteNotebook -> Text
notebookId} -> Text
notebookId) (\s :: DeleteNotebook
s@DeleteNotebook' {} Text
a -> DeleteNotebook
s {$sel:notebookId:DeleteNotebook' :: Text
notebookId = Text
a} :: DeleteNotebook)

instance Core.AWSRequest DeleteNotebook where
  type
    AWSResponse DeleteNotebook =
      DeleteNotebookResponse
  request :: (Service -> Service) -> DeleteNotebook -> Request DeleteNotebook
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteNotebook
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteNotebook)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteNotebookResponse
DeleteNotebookResponse'
            forall (f :: * -> *) a b. Functor 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 DeleteNotebook where
  hashWithSalt :: Int -> DeleteNotebook -> Int
hashWithSalt Int
_salt DeleteNotebook' {Text
notebookId :: Text
$sel:notebookId:DeleteNotebook' :: DeleteNotebook -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
notebookId

instance Prelude.NFData DeleteNotebook where
  rnf :: DeleteNotebook -> ()
rnf DeleteNotebook' {Text
notebookId :: Text
$sel:notebookId:DeleteNotebook' :: DeleteNotebook -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
notebookId

instance Data.ToHeaders DeleteNotebook where
  toHeaders :: DeleteNotebook -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonAthena.DeleteNotebook" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DeleteNotebook where
  toJSON :: DeleteNotebook -> Value
toJSON DeleteNotebook' {Text
notebookId :: Text
$sel:notebookId:DeleteNotebook' :: DeleteNotebook -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"NotebookId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
notebookId)]
      )

instance Data.ToPath DeleteNotebook where
  toPath :: DeleteNotebook -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'DeleteNotebookResponse' 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:
--
-- 'httpStatus', 'deleteNotebookResponse_httpStatus' - The response's http status code.
newDeleteNotebookResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteNotebookResponse
newDeleteNotebookResponse :: Int -> DeleteNotebookResponse
newDeleteNotebookResponse Int
pHttpStatus_ =
  DeleteNotebookResponse' {$sel:httpStatus:DeleteNotebookResponse' :: Int
httpStatus = Int
pHttpStatus_}

-- | The response's http status code.
deleteNotebookResponse_httpStatus :: Lens.Lens' DeleteNotebookResponse Prelude.Int
deleteNotebookResponse_httpStatus :: Lens' DeleteNotebookResponse Int
deleteNotebookResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNotebookResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteNotebookResponse' :: DeleteNotebookResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteNotebookResponse
s@DeleteNotebookResponse' {} Int
a -> DeleteNotebookResponse
s {$sel:httpStatus:DeleteNotebookResponse' :: Int
httpStatus = Int
a} :: DeleteNotebookResponse)

instance Prelude.NFData DeleteNotebookResponse where
  rnf :: DeleteNotebookResponse -> ()
rnf DeleteNotebookResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteNotebookResponse' :: DeleteNotebookResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus