{-# 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-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)
--
-- 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.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:/ '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
(DeleteHumanTaskUi -> DeleteHumanTaskUi -> Bool)
-> (DeleteHumanTaskUi -> DeleteHumanTaskUi -> Bool)
-> Eq DeleteHumanTaskUi
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]
(Int -> ReadS DeleteHumanTaskUi)
-> ReadS [DeleteHumanTaskUi]
-> ReadPrec DeleteHumanTaskUi
-> ReadPrec [DeleteHumanTaskUi]
-> Read 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
(Int -> DeleteHumanTaskUi -> ShowS)
-> (DeleteHumanTaskUi -> String)
-> ([DeleteHumanTaskUi] -> ShowS)
-> Show DeleteHumanTaskUi
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. DeleteHumanTaskUi -> Rep DeleteHumanTaskUi x)
-> (forall x. Rep DeleteHumanTaskUi x -> DeleteHumanTaskUi)
-> Generic DeleteHumanTaskUi
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' :: Text -> DeleteHumanTaskUi
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 :: (Text -> f Text) -> DeleteHumanTaskUi -> f DeleteHumanTaskUi
deleteHumanTaskUi_humanTaskUiName = (DeleteHumanTaskUi -> Text)
-> (DeleteHumanTaskUi -> Text -> DeleteHumanTaskUi)
-> Lens DeleteHumanTaskUi DeleteHumanTaskUi Text Text
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 :: DeleteHumanTaskUi -> Request DeleteHumanTaskUi
request = Service -> DeleteHumanTaskUi -> Request DeleteHumanTaskUi
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteHumanTaskUi
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteHumanTaskUi)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteHumanTaskUi))
-> Logger
-> Service
-> Proxy DeleteHumanTaskUi
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteHumanTaskUi)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteHumanTaskUiResponse
DeleteHumanTaskUiResponse'
            (Int -> DeleteHumanTaskUiResponse)
-> Either String Int -> Either String DeleteHumanTaskUiResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteHumanTaskUi

instance Prelude.NFData DeleteHumanTaskUi

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

instance Core.ToJSON DeleteHumanTaskUi where
  toJSON :: DeleteHumanTaskUi -> Value
toJSON DeleteHumanTaskUi' {Text
humanTaskUiName :: Text
$sel:humanTaskUiName:DeleteHumanTaskUi' :: DeleteHumanTaskUi -> 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
"HumanTaskUiName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
humanTaskUiName)
          ]
      )

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

instance Core.ToQuery DeleteHumanTaskUi where
  toQuery :: DeleteHumanTaskUi -> QueryString
toQuery = QueryString -> DeleteHumanTaskUi -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DeleteHumanTaskUiResponse -> DeleteHumanTaskUiResponse -> Bool)
-> (DeleteHumanTaskUiResponse -> DeleteHumanTaskUiResponse -> Bool)
-> Eq DeleteHumanTaskUiResponse
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]
(Int -> ReadS DeleteHumanTaskUiResponse)
-> ReadS [DeleteHumanTaskUiResponse]
-> ReadPrec DeleteHumanTaskUiResponse
-> ReadPrec [DeleteHumanTaskUiResponse]
-> Read 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
(Int -> DeleteHumanTaskUiResponse -> ShowS)
-> (DeleteHumanTaskUiResponse -> String)
-> ([DeleteHumanTaskUiResponse] -> ShowS)
-> Show DeleteHumanTaskUiResponse
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.
 DeleteHumanTaskUiResponse -> Rep DeleteHumanTaskUiResponse x)
-> (forall x.
    Rep DeleteHumanTaskUiResponse x -> DeleteHumanTaskUiResponse)
-> Generic DeleteHumanTaskUiResponse
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' :: Int -> DeleteHumanTaskUiResponse
DeleteHumanTaskUiResponse'
    { $sel:httpStatus:DeleteHumanTaskUiResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteHumanTaskUiResponse_httpStatus :: Lens.Lens' DeleteHumanTaskUiResponse Prelude.Int
deleteHumanTaskUiResponse_httpStatus :: (Int -> f Int)
-> DeleteHumanTaskUiResponse -> f DeleteHumanTaskUiResponse
deleteHumanTaskUiResponse_httpStatus = (DeleteHumanTaskUiResponse -> Int)
-> (DeleteHumanTaskUiResponse -> Int -> DeleteHumanTaskUiResponse)
-> Lens DeleteHumanTaskUiResponse DeleteHumanTaskUiResponse Int Int
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