{-# 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-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)
--
-- 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.Lens as Lens
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
(DeleteStudioLifecycleConfig
 -> DeleteStudioLifecycleConfig -> Bool)
-> (DeleteStudioLifecycleConfig
    -> DeleteStudioLifecycleConfig -> Bool)
-> Eq DeleteStudioLifecycleConfig
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]
(Int -> ReadS DeleteStudioLifecycleConfig)
-> ReadS [DeleteStudioLifecycleConfig]
-> ReadPrec DeleteStudioLifecycleConfig
-> ReadPrec [DeleteStudioLifecycleConfig]
-> Read 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
(Int -> DeleteStudioLifecycleConfig -> ShowS)
-> (DeleteStudioLifecycleConfig -> String)
-> ([DeleteStudioLifecycleConfig] -> ShowS)
-> Show DeleteStudioLifecycleConfig
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.
 DeleteStudioLifecycleConfig -> Rep DeleteStudioLifecycleConfig x)
-> (forall x.
    Rep DeleteStudioLifecycleConfig x -> DeleteStudioLifecycleConfig)
-> Generic DeleteStudioLifecycleConfig
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' :: Text -> DeleteStudioLifecycleConfig
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 :: (Text -> f Text)
-> DeleteStudioLifecycleConfig -> f DeleteStudioLifecycleConfig
deleteStudioLifecycleConfig_studioLifecycleConfigName = (DeleteStudioLifecycleConfig -> Text)
-> (DeleteStudioLifecycleConfig
    -> Text -> DeleteStudioLifecycleConfig)
-> Lens
     DeleteStudioLifecycleConfig DeleteStudioLifecycleConfig Text Text
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 :: DeleteStudioLifecycleConfig -> Request DeleteStudioLifecycleConfig
request = Service
-> DeleteStudioLifecycleConfig
-> Request DeleteStudioLifecycleConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteStudioLifecycleConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteStudioLifecycleConfig)))
response =
    AWSResponse DeleteStudioLifecycleConfig
-> Logger
-> Service
-> Proxy DeleteStudioLifecycleConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteStudioLifecycleConfig)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteStudioLifecycleConfig
DeleteStudioLifecycleConfigResponse
DeleteStudioLifecycleConfigResponse'

instance Prelude.Hashable DeleteStudioLifecycleConfig

instance Prelude.NFData DeleteStudioLifecycleConfig

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

instance Core.ToJSON DeleteStudioLifecycleConfig where
  toJSON :: DeleteStudioLifecycleConfig -> Value
toJSON DeleteStudioLifecycleConfig' {Text
studioLifecycleConfigName :: Text
$sel:studioLifecycleConfigName:DeleteStudioLifecycleConfig' :: DeleteStudioLifecycleConfig -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"StudioLifecycleConfigName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
studioLifecycleConfigName
              )
          ]
      )

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

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

-- | /See:/ 'newDeleteStudioLifecycleConfigResponse' smart constructor.
data DeleteStudioLifecycleConfigResponse = DeleteStudioLifecycleConfigResponse'
  {
  }
  deriving (DeleteStudioLifecycleConfigResponse
-> DeleteStudioLifecycleConfigResponse -> Bool
(DeleteStudioLifecycleConfigResponse
 -> DeleteStudioLifecycleConfigResponse -> Bool)
-> (DeleteStudioLifecycleConfigResponse
    -> DeleteStudioLifecycleConfigResponse -> Bool)
-> Eq DeleteStudioLifecycleConfigResponse
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]
(Int -> ReadS DeleteStudioLifecycleConfigResponse)
-> ReadS [DeleteStudioLifecycleConfigResponse]
-> ReadPrec DeleteStudioLifecycleConfigResponse
-> ReadPrec [DeleteStudioLifecycleConfigResponse]
-> Read 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
(Int -> DeleteStudioLifecycleConfigResponse -> ShowS)
-> (DeleteStudioLifecycleConfigResponse -> String)
-> ([DeleteStudioLifecycleConfigResponse] -> ShowS)
-> Show DeleteStudioLifecycleConfigResponse
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.
 DeleteStudioLifecycleConfigResponse
 -> Rep DeleteStudioLifecycleConfigResponse x)
-> (forall x.
    Rep DeleteStudioLifecycleConfigResponse x
    -> DeleteStudioLifecycleConfigResponse)
-> Generic DeleteStudioLifecycleConfigResponse
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