{-# 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.DeleteHumanTaskUi
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Use this operation to delete a human task user interface (worker task
-- template).
--
-- To see a list of human task user interfaces (work task templates) in
-- your account, use . When you delete a worker task template, it no longer
-- appears when you call @ListHumanTaskUis@.
module Amazonka.SageMaker.DeleteHumanTaskUi
  ( -- * Creating a Request
    DeleteHumanTaskUi (..),
    newDeleteHumanTaskUi,

    -- * Request Lenses
    deleteHumanTaskUi_humanTaskUiName,

    -- * Destructuring the Response
    DeleteHumanTaskUiResponse (..),
    newDeleteHumanTaskUiResponse,

    -- * Response Lenses
    deleteHumanTaskUiResponse_httpStatus,
  )
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:/ 'newDeleteHumanTaskUi' smart constructor.
data DeleteHumanTaskUi = DeleteHumanTaskUi'
  { -- | The name of the human task user interface (work task template) you want
    -- to delete.
    DeleteHumanTaskUi -> Text
humanTaskUiName :: Prelude.Text
  }
  deriving (DeleteHumanTaskUi -> DeleteHumanTaskUi -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteHumanTaskUi -> DeleteHumanTaskUi -> Bool
$c/= :: DeleteHumanTaskUi -> DeleteHumanTaskUi -> Bool
== :: DeleteHumanTaskUi -> DeleteHumanTaskUi -> Bool
$c== :: DeleteHumanTaskUi -> DeleteHumanTaskUi -> Bool
Prelude.Eq, ReadPrec [DeleteHumanTaskUi]
ReadPrec DeleteHumanTaskUi
Int -> ReadS DeleteHumanTaskUi
ReadS [DeleteHumanTaskUi]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteHumanTaskUi]
$creadListPrec :: ReadPrec [DeleteHumanTaskUi]
readPrec :: ReadPrec DeleteHumanTaskUi
$creadPrec :: ReadPrec DeleteHumanTaskUi
readList :: ReadS [DeleteHumanTaskUi]
$creadList :: ReadS [DeleteHumanTaskUi]
readsPrec :: Int -> ReadS DeleteHumanTaskUi
$creadsPrec :: Int -> ReadS DeleteHumanTaskUi
Prelude.Read, Int -> DeleteHumanTaskUi -> ShowS
[DeleteHumanTaskUi] -> ShowS
DeleteHumanTaskUi -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteHumanTaskUi] -> ShowS
$cshowList :: [DeleteHumanTaskUi] -> ShowS
show :: DeleteHumanTaskUi -> String
$cshow :: DeleteHumanTaskUi -> String
showsPrec :: Int -> DeleteHumanTaskUi -> ShowS
$cshowsPrec :: Int -> DeleteHumanTaskUi -> ShowS
Prelude.Show, forall x. Rep DeleteHumanTaskUi x -> DeleteHumanTaskUi
forall x. DeleteHumanTaskUi -> Rep DeleteHumanTaskUi x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteHumanTaskUi x -> DeleteHumanTaskUi
$cfrom :: forall x. DeleteHumanTaskUi -> Rep DeleteHumanTaskUi x
Prelude.Generic)

-- |
-- Create a value of 'DeleteHumanTaskUi' 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:
--
-- 'humanTaskUiName', 'deleteHumanTaskUi_humanTaskUiName' - The name of the human task user interface (work task template) you want
-- to delete.
newDeleteHumanTaskUi ::
  -- | 'humanTaskUiName'
  Prelude.Text ->
  DeleteHumanTaskUi
newDeleteHumanTaskUi :: Text -> DeleteHumanTaskUi
newDeleteHumanTaskUi Text
pHumanTaskUiName_ =
  DeleteHumanTaskUi'
    { $sel:humanTaskUiName:DeleteHumanTaskUi' :: Text
humanTaskUiName =
        Text
pHumanTaskUiName_
    }

-- | The name of the human task user interface (work task template) you want
-- to delete.
deleteHumanTaskUi_humanTaskUiName :: Lens.Lens' DeleteHumanTaskUi Prelude.Text
deleteHumanTaskUi_humanTaskUiName :: Lens' DeleteHumanTaskUi Text
deleteHumanTaskUi_humanTaskUiName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHumanTaskUi' {Text
humanTaskUiName :: Text
$sel:humanTaskUiName:DeleteHumanTaskUi' :: DeleteHumanTaskUi -> Text
humanTaskUiName} -> Text
humanTaskUiName) (\s :: DeleteHumanTaskUi
s@DeleteHumanTaskUi' {} Text
a -> DeleteHumanTaskUi
s {$sel:humanTaskUiName:DeleteHumanTaskUi' :: Text
humanTaskUiName = Text
a} :: DeleteHumanTaskUi)

instance Core.AWSRequest DeleteHumanTaskUi where
  type
    AWSResponse DeleteHumanTaskUi =
      DeleteHumanTaskUiResponse
  request :: (Service -> Service)
-> DeleteHumanTaskUi -> Request DeleteHumanTaskUi
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 DeleteHumanTaskUi
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteHumanTaskUi)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteHumanTaskUiResponse
DeleteHumanTaskUiResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

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

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

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

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

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

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

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

-- |
-- Create a value of 'DeleteHumanTaskUiResponse' 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:
--
-- 'httpStatus', 'deleteHumanTaskUiResponse_httpStatus' - The response's http status code.
newDeleteHumanTaskUiResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteHumanTaskUiResponse
newDeleteHumanTaskUiResponse :: Int -> DeleteHumanTaskUiResponse
newDeleteHumanTaskUiResponse Int
pHttpStatus_ =
  DeleteHumanTaskUiResponse'
    { $sel:httpStatus:DeleteHumanTaskUiResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteHumanTaskUiResponse_httpStatus :: Lens.Lens' DeleteHumanTaskUiResponse Prelude.Int
deleteHumanTaskUiResponse_httpStatus :: Lens' DeleteHumanTaskUiResponse Int
deleteHumanTaskUiResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHumanTaskUiResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteHumanTaskUiResponse' :: DeleteHumanTaskUiResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteHumanTaskUiResponse
s@DeleteHumanTaskUiResponse' {} Int
a -> DeleteHumanTaskUiResponse
s {$sel:httpStatus:DeleteHumanTaskUiResponse' :: Int
httpStatus = Int
a} :: DeleteHumanTaskUiResponse)

instance Prelude.NFData DeleteHumanTaskUiResponse where
  rnf :: DeleteHumanTaskUiResponse -> ()
rnf DeleteHumanTaskUiResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteHumanTaskUiResponse' :: DeleteHumanTaskUiResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus