{-# 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.DeleteHub
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Delete a hub.
module Amazonka.SageMaker.DeleteHub
  ( -- * Creating a Request
    DeleteHub (..),
    newDeleteHub,

    -- * Request Lenses
    deleteHub_hubName,

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

-- |
-- Create a value of 'DeleteHub' 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:
--
-- 'hubName', 'deleteHub_hubName' - The name of the hub to delete.
newDeleteHub ::
  -- | 'hubName'
  Prelude.Text ->
  DeleteHub
newDeleteHub :: Text -> DeleteHub
newDeleteHub Text
pHubName_ =
  DeleteHub' {$sel:hubName:DeleteHub' :: Text
hubName = Text
pHubName_}

-- | The name of the hub to delete.
deleteHub_hubName :: Lens.Lens' DeleteHub Prelude.Text
deleteHub_hubName :: Lens' DeleteHub Text
deleteHub_hubName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHub' {Text
hubName :: Text
$sel:hubName:DeleteHub' :: DeleteHub -> Text
hubName} -> Text
hubName) (\s :: DeleteHub
s@DeleteHub' {} Text
a -> DeleteHub
s {$sel:hubName:DeleteHub' :: Text
hubName = Text
a} :: DeleteHub)

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

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

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

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

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

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

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

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

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