{-# 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.SageMakerA2IRuntime.DeleteHumanLoop
-- 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 specified human loop for a flow definition.
--
-- If the human loop was deleted, this operation will return a
-- @ResourceNotFoundException@.
module Amazonka.SageMakerA2IRuntime.DeleteHumanLoop
  ( -- * Creating a Request
    DeleteHumanLoop (..),
    newDeleteHumanLoop,

    -- * Request Lenses
    deleteHumanLoop_humanLoopName,

    -- * Destructuring the Response
    DeleteHumanLoopResponse (..),
    newDeleteHumanLoopResponse,

    -- * Response Lenses
    deleteHumanLoopResponse_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.SageMakerA2IRuntime.Types

-- | /See:/ 'newDeleteHumanLoop' smart constructor.
data DeleteHumanLoop = DeleteHumanLoop'
  { -- | The name of the human loop that you want to delete.
    DeleteHumanLoop -> Text
humanLoopName :: Prelude.Text
  }
  deriving (DeleteHumanLoop -> DeleteHumanLoop -> Bool
(DeleteHumanLoop -> DeleteHumanLoop -> Bool)
-> (DeleteHumanLoop -> DeleteHumanLoop -> Bool)
-> Eq DeleteHumanLoop
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteHumanLoop -> DeleteHumanLoop -> Bool
$c/= :: DeleteHumanLoop -> DeleteHumanLoop -> Bool
== :: DeleteHumanLoop -> DeleteHumanLoop -> Bool
$c== :: DeleteHumanLoop -> DeleteHumanLoop -> Bool
Prelude.Eq, ReadPrec [DeleteHumanLoop]
ReadPrec DeleteHumanLoop
Int -> ReadS DeleteHumanLoop
ReadS [DeleteHumanLoop]
(Int -> ReadS DeleteHumanLoop)
-> ReadS [DeleteHumanLoop]
-> ReadPrec DeleteHumanLoop
-> ReadPrec [DeleteHumanLoop]
-> Read DeleteHumanLoop
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteHumanLoop]
$creadListPrec :: ReadPrec [DeleteHumanLoop]
readPrec :: ReadPrec DeleteHumanLoop
$creadPrec :: ReadPrec DeleteHumanLoop
readList :: ReadS [DeleteHumanLoop]
$creadList :: ReadS [DeleteHumanLoop]
readsPrec :: Int -> ReadS DeleteHumanLoop
$creadsPrec :: Int -> ReadS DeleteHumanLoop
Prelude.Read, Int -> DeleteHumanLoop -> ShowS
[DeleteHumanLoop] -> ShowS
DeleteHumanLoop -> String
(Int -> DeleteHumanLoop -> ShowS)
-> (DeleteHumanLoop -> String)
-> ([DeleteHumanLoop] -> ShowS)
-> Show DeleteHumanLoop
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteHumanLoop] -> ShowS
$cshowList :: [DeleteHumanLoop] -> ShowS
show :: DeleteHumanLoop -> String
$cshow :: DeleteHumanLoop -> String
showsPrec :: Int -> DeleteHumanLoop -> ShowS
$cshowsPrec :: Int -> DeleteHumanLoop -> ShowS
Prelude.Show, (forall x. DeleteHumanLoop -> Rep DeleteHumanLoop x)
-> (forall x. Rep DeleteHumanLoop x -> DeleteHumanLoop)
-> Generic DeleteHumanLoop
forall x. Rep DeleteHumanLoop x -> DeleteHumanLoop
forall x. DeleteHumanLoop -> Rep DeleteHumanLoop x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteHumanLoop x -> DeleteHumanLoop
$cfrom :: forall x. DeleteHumanLoop -> Rep DeleteHumanLoop x
Prelude.Generic)

-- |
-- Create a value of 'DeleteHumanLoop' 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:
--
-- 'humanLoopName', 'deleteHumanLoop_humanLoopName' - The name of the human loop that you want to delete.
newDeleteHumanLoop ::
  -- | 'humanLoopName'
  Prelude.Text ->
  DeleteHumanLoop
newDeleteHumanLoop :: Text -> DeleteHumanLoop
newDeleteHumanLoop Text
pHumanLoopName_ =
  DeleteHumanLoop' :: Text -> DeleteHumanLoop
DeleteHumanLoop' {$sel:humanLoopName:DeleteHumanLoop' :: Text
humanLoopName = Text
pHumanLoopName_}

-- | The name of the human loop that you want to delete.
deleteHumanLoop_humanLoopName :: Lens.Lens' DeleteHumanLoop Prelude.Text
deleteHumanLoop_humanLoopName :: (Text -> f Text) -> DeleteHumanLoop -> f DeleteHumanLoop
deleteHumanLoop_humanLoopName = (DeleteHumanLoop -> Text)
-> (DeleteHumanLoop -> Text -> DeleteHumanLoop)
-> Lens DeleteHumanLoop DeleteHumanLoop Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHumanLoop' {Text
humanLoopName :: Text
$sel:humanLoopName:DeleteHumanLoop' :: DeleteHumanLoop -> Text
humanLoopName} -> Text
humanLoopName) (\s :: DeleteHumanLoop
s@DeleteHumanLoop' {} Text
a -> DeleteHumanLoop
s {$sel:humanLoopName:DeleteHumanLoop' :: Text
humanLoopName = Text
a} :: DeleteHumanLoop)

instance Core.AWSRequest DeleteHumanLoop where
  type
    AWSResponse DeleteHumanLoop =
      DeleteHumanLoopResponse
  request :: DeleteHumanLoop -> Request DeleteHumanLoop
request = Service -> DeleteHumanLoop -> Request DeleteHumanLoop
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteHumanLoop
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteHumanLoop)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteHumanLoop))
-> Logger
-> Service
-> Proxy DeleteHumanLoop
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteHumanLoop)))
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 -> DeleteHumanLoopResponse
DeleteHumanLoopResponse'
            (Int -> DeleteHumanLoopResponse)
-> Either String Int -> Either String DeleteHumanLoopResponse
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 DeleteHumanLoop

instance Prelude.NFData DeleteHumanLoop

instance Core.ToHeaders DeleteHumanLoop where
  toHeaders :: DeleteHumanLoop -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteHumanLoop -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath DeleteHumanLoop where
  toPath :: DeleteHumanLoop -> ByteString
toPath DeleteHumanLoop' {Text
humanLoopName :: Text
$sel:humanLoopName:DeleteHumanLoop' :: DeleteHumanLoop -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/human-loops/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
humanLoopName]

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

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

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

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

instance Prelude.NFData DeleteHumanLoopResponse