{-# 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.SageMaker.DeleteNotebookInstanceLifecycleConfig
-- 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 notebook instance lifecycle configuration.
module Amazonka.SageMaker.DeleteNotebookInstanceLifecycleConfig
  ( -- * Creating a Request
    DeleteNotebookInstanceLifecycleConfig (..),
    newDeleteNotebookInstanceLifecycleConfig,

    -- * Request Lenses
    deleteNotebookInstanceLifecycleConfig_notebookInstanceLifecycleConfigName,

    -- * Destructuring the Response
    DeleteNotebookInstanceLifecycleConfigResponse (..),
    newDeleteNotebookInstanceLifecycleConfigResponse,
  )
where

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
import Amazonka.SageMaker.Types

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

-- |
-- Create a value of 'DeleteNotebookInstanceLifecycleConfig' 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:
--
-- 'notebookInstanceLifecycleConfigName', 'deleteNotebookInstanceLifecycleConfig_notebookInstanceLifecycleConfigName' - The name of the lifecycle configuration to delete.
newDeleteNotebookInstanceLifecycleConfig ::
  -- | 'notebookInstanceLifecycleConfigName'
  Prelude.Text ->
  DeleteNotebookInstanceLifecycleConfig
newDeleteNotebookInstanceLifecycleConfig :: Text -> DeleteNotebookInstanceLifecycleConfig
newDeleteNotebookInstanceLifecycleConfig
  Text
pNotebookInstanceLifecycleConfigName_ =
    DeleteNotebookInstanceLifecycleConfig'
      { $sel:notebookInstanceLifecycleConfigName:DeleteNotebookInstanceLifecycleConfig' :: Text
notebookInstanceLifecycleConfigName =
          Text
pNotebookInstanceLifecycleConfigName_
      }

-- | The name of the lifecycle configuration to delete.
deleteNotebookInstanceLifecycleConfig_notebookInstanceLifecycleConfigName :: Lens.Lens' DeleteNotebookInstanceLifecycleConfig Prelude.Text
deleteNotebookInstanceLifecycleConfig_notebookInstanceLifecycleConfigName :: Lens' DeleteNotebookInstanceLifecycleConfig Text
deleteNotebookInstanceLifecycleConfig_notebookInstanceLifecycleConfigName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNotebookInstanceLifecycleConfig' {Text
notebookInstanceLifecycleConfigName :: Text
$sel:notebookInstanceLifecycleConfigName:DeleteNotebookInstanceLifecycleConfig' :: DeleteNotebookInstanceLifecycleConfig -> Text
notebookInstanceLifecycleConfigName} -> Text
notebookInstanceLifecycleConfigName) (\s :: DeleteNotebookInstanceLifecycleConfig
s@DeleteNotebookInstanceLifecycleConfig' {} Text
a -> DeleteNotebookInstanceLifecycleConfig
s {$sel:notebookInstanceLifecycleConfigName:DeleteNotebookInstanceLifecycleConfig' :: Text
notebookInstanceLifecycleConfigName = Text
a} :: DeleteNotebookInstanceLifecycleConfig)

instance
  Core.AWSRequest
    DeleteNotebookInstanceLifecycleConfig
  where
  type
    AWSResponse
      DeleteNotebookInstanceLifecycleConfig =
      DeleteNotebookInstanceLifecycleConfigResponse
  request :: (Service -> Service)
-> DeleteNotebookInstanceLifecycleConfig
-> Request DeleteNotebookInstanceLifecycleConfig
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 DeleteNotebookInstanceLifecycleConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DeleteNotebookInstanceLifecycleConfig)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteNotebookInstanceLifecycleConfigResponse
DeleteNotebookInstanceLifecycleConfigResponse'

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

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

instance
  Data.ToHeaders
    DeleteNotebookInstanceLifecycleConfig
  where
  toHeaders :: DeleteNotebookInstanceLifecycleConfig -> [Header]
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 -> [Header]
Data.=# ( ByteString
"SageMaker.DeleteNotebookInstanceLifecycleConfig" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

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

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

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

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

-- |
-- Create a value of 'DeleteNotebookInstanceLifecycleConfigResponse' 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.
newDeleteNotebookInstanceLifecycleConfigResponse ::
  DeleteNotebookInstanceLifecycleConfigResponse
newDeleteNotebookInstanceLifecycleConfigResponse :: DeleteNotebookInstanceLifecycleConfigResponse
newDeleteNotebookInstanceLifecycleConfigResponse =
  DeleteNotebookInstanceLifecycleConfigResponse
DeleteNotebookInstanceLifecycleConfigResponse'

instance
  Prelude.NFData
    DeleteNotebookInstanceLifecycleConfigResponse
  where
  rnf :: DeleteNotebookInstanceLifecycleConfigResponse -> ()
rnf DeleteNotebookInstanceLifecycleConfigResponse
_ = ()