{-# 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.DeleteStudioLifecycleConfig
-- 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 Studio Lifecycle Configuration. In order to delete the
-- Lifecycle Configuration, there must be no running apps using the
-- Lifecycle Configuration. You must also remove the Lifecycle
-- Configuration from UserSettings in all Domains and UserProfiles.
module Amazonka.SageMaker.DeleteStudioLifecycleConfig
  ( -- * Creating a Request
    DeleteStudioLifecycleConfig (..),
    newDeleteStudioLifecycleConfig,

    -- * Request Lenses
    deleteStudioLifecycleConfig_studioLifecycleConfigName,

    -- * Destructuring the Response
    DeleteStudioLifecycleConfigResponse (..),
    newDeleteStudioLifecycleConfigResponse,
  )
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:/ 'newDeleteStudioLifecycleConfig' smart constructor.
data DeleteStudioLifecycleConfig = DeleteStudioLifecycleConfig'
  { -- | The name of the Studio Lifecycle Configuration to delete.
    DeleteStudioLifecycleConfig -> Text
studioLifecycleConfigName :: Prelude.Text
  }
  deriving (DeleteStudioLifecycleConfig -> DeleteStudioLifecycleConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStudioLifecycleConfig -> DeleteStudioLifecycleConfig -> Bool
$c/= :: DeleteStudioLifecycleConfig -> DeleteStudioLifecycleConfig -> Bool
== :: DeleteStudioLifecycleConfig -> DeleteStudioLifecycleConfig -> Bool
$c== :: DeleteStudioLifecycleConfig -> DeleteStudioLifecycleConfig -> Bool
Prelude.Eq, ReadPrec [DeleteStudioLifecycleConfig]
ReadPrec DeleteStudioLifecycleConfig
Int -> ReadS DeleteStudioLifecycleConfig
ReadS [DeleteStudioLifecycleConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStudioLifecycleConfig]
$creadListPrec :: ReadPrec [DeleteStudioLifecycleConfig]
readPrec :: ReadPrec DeleteStudioLifecycleConfig
$creadPrec :: ReadPrec DeleteStudioLifecycleConfig
readList :: ReadS [DeleteStudioLifecycleConfig]
$creadList :: ReadS [DeleteStudioLifecycleConfig]
readsPrec :: Int -> ReadS DeleteStudioLifecycleConfig
$creadsPrec :: Int -> ReadS DeleteStudioLifecycleConfig
Prelude.Read, Int -> DeleteStudioLifecycleConfig -> ShowS
[DeleteStudioLifecycleConfig] -> ShowS
DeleteStudioLifecycleConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStudioLifecycleConfig] -> ShowS
$cshowList :: [DeleteStudioLifecycleConfig] -> ShowS
show :: DeleteStudioLifecycleConfig -> String
$cshow :: DeleteStudioLifecycleConfig -> String
showsPrec :: Int -> DeleteStudioLifecycleConfig -> ShowS
$cshowsPrec :: Int -> DeleteStudioLifecycleConfig -> ShowS
Prelude.Show, forall x.
Rep DeleteStudioLifecycleConfig x -> DeleteStudioLifecycleConfig
forall x.
DeleteStudioLifecycleConfig -> Rep DeleteStudioLifecycleConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteStudioLifecycleConfig x -> DeleteStudioLifecycleConfig
$cfrom :: forall x.
DeleteStudioLifecycleConfig -> Rep DeleteStudioLifecycleConfig x
Prelude.Generic)

-- |
-- Create a value of 'DeleteStudioLifecycleConfig' 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:
--
-- 'studioLifecycleConfigName', 'deleteStudioLifecycleConfig_studioLifecycleConfigName' - The name of the Studio Lifecycle Configuration to delete.
newDeleteStudioLifecycleConfig ::
  -- | 'studioLifecycleConfigName'
  Prelude.Text ->
  DeleteStudioLifecycleConfig
newDeleteStudioLifecycleConfig :: Text -> DeleteStudioLifecycleConfig
newDeleteStudioLifecycleConfig
  Text
pStudioLifecycleConfigName_ =
    DeleteStudioLifecycleConfig'
      { $sel:studioLifecycleConfigName:DeleteStudioLifecycleConfig' :: Text
studioLifecycleConfigName =
          Text
pStudioLifecycleConfigName_
      }

-- | The name of the Studio Lifecycle Configuration to delete.
deleteStudioLifecycleConfig_studioLifecycleConfigName :: Lens.Lens' DeleteStudioLifecycleConfig Prelude.Text
deleteStudioLifecycleConfig_studioLifecycleConfigName :: Lens' DeleteStudioLifecycleConfig Text
deleteStudioLifecycleConfig_studioLifecycleConfigName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStudioLifecycleConfig' {Text
studioLifecycleConfigName :: Text
$sel:studioLifecycleConfigName:DeleteStudioLifecycleConfig' :: DeleteStudioLifecycleConfig -> Text
studioLifecycleConfigName} -> Text
studioLifecycleConfigName) (\s :: DeleteStudioLifecycleConfig
s@DeleteStudioLifecycleConfig' {} Text
a -> DeleteStudioLifecycleConfig
s {$sel:studioLifecycleConfigName:DeleteStudioLifecycleConfig' :: Text
studioLifecycleConfigName = Text
a} :: DeleteStudioLifecycleConfig)

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

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

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

instance Data.ToHeaders DeleteStudioLifecycleConfig where
  toHeaders :: DeleteStudioLifecycleConfig -> [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.DeleteStudioLifecycleConfig" ::
                          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 DeleteStudioLifecycleConfig where
  toJSON :: DeleteStudioLifecycleConfig -> Value
toJSON DeleteStudioLifecycleConfig' {Text
studioLifecycleConfigName :: Text
$sel:studioLifecycleConfigName:DeleteStudioLifecycleConfig' :: DeleteStudioLifecycleConfig -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"StudioLifecycleConfigName"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
studioLifecycleConfigName
              )
          ]
      )

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

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

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

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

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