{-# 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.DeleteAppImageConfig
-- 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 an AppImageConfig.
module Amazonka.SageMaker.DeleteAppImageConfig
  ( -- * Creating a Request
    DeleteAppImageConfig (..),
    newDeleteAppImageConfig,

    -- * Request Lenses
    deleteAppImageConfig_appImageConfigName,

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

-- |
-- Create a value of 'DeleteAppImageConfig' 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:
--
-- 'appImageConfigName', 'deleteAppImageConfig_appImageConfigName' - The name of the AppImageConfig to delete.
newDeleteAppImageConfig ::
  -- | 'appImageConfigName'
  Prelude.Text ->
  DeleteAppImageConfig
newDeleteAppImageConfig :: Text -> DeleteAppImageConfig
newDeleteAppImageConfig Text
pAppImageConfigName_ =
  DeleteAppImageConfig' :: Text -> DeleteAppImageConfig
DeleteAppImageConfig'
    { $sel:appImageConfigName:DeleteAppImageConfig' :: Text
appImageConfigName =
        Text
pAppImageConfigName_
    }

-- | The name of the AppImageConfig to delete.
deleteAppImageConfig_appImageConfigName :: Lens.Lens' DeleteAppImageConfig Prelude.Text
deleteAppImageConfig_appImageConfigName :: (Text -> f Text) -> DeleteAppImageConfig -> f DeleteAppImageConfig
deleteAppImageConfig_appImageConfigName = (DeleteAppImageConfig -> Text)
-> (DeleteAppImageConfig -> Text -> DeleteAppImageConfig)
-> Lens DeleteAppImageConfig DeleteAppImageConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAppImageConfig' {Text
appImageConfigName :: Text
$sel:appImageConfigName:DeleteAppImageConfig' :: DeleteAppImageConfig -> Text
appImageConfigName} -> Text
appImageConfigName) (\s :: DeleteAppImageConfig
s@DeleteAppImageConfig' {} Text
a -> DeleteAppImageConfig
s {$sel:appImageConfigName:DeleteAppImageConfig' :: Text
appImageConfigName = Text
a} :: DeleteAppImageConfig)

instance Core.AWSRequest DeleteAppImageConfig where
  type
    AWSResponse DeleteAppImageConfig =
      DeleteAppImageConfigResponse
  request :: DeleteAppImageConfig -> Request DeleteAppImageConfig
request = Service -> DeleteAppImageConfig -> Request DeleteAppImageConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteAppImageConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAppImageConfig)))
response =
    AWSResponse DeleteAppImageConfig
-> Logger
-> Service
-> Proxy DeleteAppImageConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAppImageConfig)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteAppImageConfig
DeleteAppImageConfigResponse
DeleteAppImageConfigResponse'

instance Prelude.Hashable DeleteAppImageConfig

instance Prelude.NFData DeleteAppImageConfig

instance Core.ToHeaders DeleteAppImageConfig where
  toHeaders :: DeleteAppImageConfig -> [Header]
toHeaders =
    [Header] -> DeleteAppImageConfig -> [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.DeleteAppImageConfig" ::
                          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 DeleteAppImageConfig where
  toJSON :: DeleteAppImageConfig -> Value
toJSON DeleteAppImageConfig' {Text
appImageConfigName :: Text
$sel:appImageConfigName:DeleteAppImageConfig' :: DeleteAppImageConfig -> 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
"AppImageConfigName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
appImageConfigName)
          ]
      )

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

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

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

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

instance Prelude.NFData DeleteAppImageConfigResponse