{-# 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.DescribeHumanLoop
-- 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)
--
-- Returns information about the specified human loop. If the human loop
-- was deleted, this operation will return a @ResourceNotFoundException@
-- error.
module Amazonka.SageMakerA2IRuntime.DescribeHumanLoop
  ( -- * Creating a Request
    DescribeHumanLoop (..),
    newDescribeHumanLoop,

    -- * Request Lenses
    describeHumanLoop_humanLoopName,

    -- * Destructuring the Response
    DescribeHumanLoopResponse (..),
    newDescribeHumanLoopResponse,

    -- * Response Lenses
    describeHumanLoopResponse_failureReason,
    describeHumanLoopResponse_failureCode,
    describeHumanLoopResponse_humanLoopOutput,
    describeHumanLoopResponse_httpStatus,
    describeHumanLoopResponse_creationTime,
    describeHumanLoopResponse_humanLoopStatus,
    describeHumanLoopResponse_humanLoopName,
    describeHumanLoopResponse_humanLoopArn,
    describeHumanLoopResponse_flowDefinitionArn,
  )
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:/ 'newDescribeHumanLoop' smart constructor.
data DescribeHumanLoop = DescribeHumanLoop'
  { -- | The name of the human loop that you want information about.
    DescribeHumanLoop -> Text
humanLoopName :: Prelude.Text
  }
  deriving (DescribeHumanLoop -> DescribeHumanLoop -> Bool
(DescribeHumanLoop -> DescribeHumanLoop -> Bool)
-> (DescribeHumanLoop -> DescribeHumanLoop -> Bool)
-> Eq DescribeHumanLoop
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHumanLoop -> DescribeHumanLoop -> Bool
$c/= :: DescribeHumanLoop -> DescribeHumanLoop -> Bool
== :: DescribeHumanLoop -> DescribeHumanLoop -> Bool
$c== :: DescribeHumanLoop -> DescribeHumanLoop -> Bool
Prelude.Eq, ReadPrec [DescribeHumanLoop]
ReadPrec DescribeHumanLoop
Int -> ReadS DescribeHumanLoop
ReadS [DescribeHumanLoop]
(Int -> ReadS DescribeHumanLoop)
-> ReadS [DescribeHumanLoop]
-> ReadPrec DescribeHumanLoop
-> ReadPrec [DescribeHumanLoop]
-> Read DescribeHumanLoop
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHumanLoop]
$creadListPrec :: ReadPrec [DescribeHumanLoop]
readPrec :: ReadPrec DescribeHumanLoop
$creadPrec :: ReadPrec DescribeHumanLoop
readList :: ReadS [DescribeHumanLoop]
$creadList :: ReadS [DescribeHumanLoop]
readsPrec :: Int -> ReadS DescribeHumanLoop
$creadsPrec :: Int -> ReadS DescribeHumanLoop
Prelude.Read, Int -> DescribeHumanLoop -> ShowS
[DescribeHumanLoop] -> ShowS
DescribeHumanLoop -> String
(Int -> DescribeHumanLoop -> ShowS)
-> (DescribeHumanLoop -> String)
-> ([DescribeHumanLoop] -> ShowS)
-> Show DescribeHumanLoop
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHumanLoop] -> ShowS
$cshowList :: [DescribeHumanLoop] -> ShowS
show :: DescribeHumanLoop -> String
$cshow :: DescribeHumanLoop -> String
showsPrec :: Int -> DescribeHumanLoop -> ShowS
$cshowsPrec :: Int -> DescribeHumanLoop -> ShowS
Prelude.Show, (forall x. DescribeHumanLoop -> Rep DescribeHumanLoop x)
-> (forall x. Rep DescribeHumanLoop x -> DescribeHumanLoop)
-> Generic DescribeHumanLoop
forall x. Rep DescribeHumanLoop x -> DescribeHumanLoop
forall x. DescribeHumanLoop -> Rep DescribeHumanLoop x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeHumanLoop x -> DescribeHumanLoop
$cfrom :: forall x. DescribeHumanLoop -> Rep DescribeHumanLoop x
Prelude.Generic)

-- |
-- Create a value of 'DescribeHumanLoop' 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', 'describeHumanLoop_humanLoopName' - The name of the human loop that you want information about.
newDescribeHumanLoop ::
  -- | 'humanLoopName'
  Prelude.Text ->
  DescribeHumanLoop
newDescribeHumanLoop :: Text -> DescribeHumanLoop
newDescribeHumanLoop Text
pHumanLoopName_ =
  DescribeHumanLoop' :: Text -> DescribeHumanLoop
DescribeHumanLoop' {$sel:humanLoopName:DescribeHumanLoop' :: Text
humanLoopName = Text
pHumanLoopName_}

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

instance Core.AWSRequest DescribeHumanLoop where
  type
    AWSResponse DescribeHumanLoop =
      DescribeHumanLoopResponse
  request :: DescribeHumanLoop -> Request DescribeHumanLoop
request = Service -> DescribeHumanLoop -> Request DescribeHumanLoop
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeHumanLoop
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeHumanLoop)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeHumanLoop))
-> Logger
-> Service
-> Proxy DescribeHumanLoop
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeHumanLoop)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe HumanLoopOutput
-> Int
-> POSIX
-> HumanLoopStatus
-> Text
-> Text
-> Text
-> DescribeHumanLoopResponse
DescribeHumanLoopResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe HumanLoopOutput
 -> Int
 -> POSIX
 -> HumanLoopStatus
 -> Text
 -> Text
 -> Text
 -> DescribeHumanLoopResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe HumanLoopOutput
      -> Int
      -> POSIX
      -> HumanLoopStatus
      -> Text
      -> Text
      -> Text
      -> DescribeHumanLoopResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FailureReason")
            Either
  String
  (Maybe Text
   -> Maybe HumanLoopOutput
   -> Int
   -> POSIX
   -> HumanLoopStatus
   -> Text
   -> Text
   -> Text
   -> DescribeHumanLoopResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe HumanLoopOutput
      -> Int
      -> POSIX
      -> HumanLoopStatus
      -> Text
      -> Text
      -> Text
      -> DescribeHumanLoopResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FailureCode")
            Either
  String
  (Maybe HumanLoopOutput
   -> Int
   -> POSIX
   -> HumanLoopStatus
   -> Text
   -> Text
   -> Text
   -> DescribeHumanLoopResponse)
-> Either String (Maybe HumanLoopOutput)
-> Either
     String
     (Int
      -> POSIX
      -> HumanLoopStatus
      -> Text
      -> Text
      -> Text
      -> DescribeHumanLoopResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe HumanLoopOutput)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HumanLoopOutput")
            Either
  String
  (Int
   -> POSIX
   -> HumanLoopStatus
   -> Text
   -> Text
   -> Text
   -> DescribeHumanLoopResponse)
-> Either String Int
-> Either
     String
     (POSIX
      -> HumanLoopStatus
      -> Text
      -> Text
      -> Text
      -> DescribeHumanLoopResponse)
forall (f :: * -> *) a b. Applicative f => 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))
            Either
  String
  (POSIX
   -> HumanLoopStatus
   -> Text
   -> Text
   -> Text
   -> DescribeHumanLoopResponse)
-> Either String POSIX
-> Either
     String
     (HumanLoopStatus
      -> Text -> Text -> Text -> DescribeHumanLoopResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"CreationTime")
            Either
  String
  (HumanLoopStatus
   -> Text -> Text -> Text -> DescribeHumanLoopResponse)
-> Either String HumanLoopStatus
-> Either
     String (Text -> Text -> Text -> DescribeHumanLoopResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String HumanLoopStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"HumanLoopStatus")
            Either String (Text -> Text -> Text -> DescribeHumanLoopResponse)
-> Either String Text
-> Either String (Text -> Text -> DescribeHumanLoopResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"HumanLoopName")
            Either String (Text -> Text -> DescribeHumanLoopResponse)
-> Either String Text
-> Either String (Text -> DescribeHumanLoopResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"HumanLoopArn")
            Either String (Text -> DescribeHumanLoopResponse)
-> Either String Text -> Either String DescribeHumanLoopResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"FlowDefinitionArn")
      )

instance Prelude.Hashable DescribeHumanLoop

instance Prelude.NFData DescribeHumanLoop

instance Core.ToHeaders DescribeHumanLoop where
  toHeaders :: DescribeHumanLoop -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeHumanLoop -> 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 DescribeHumanLoop where
  toPath :: DescribeHumanLoop -> ByteString
toPath DescribeHumanLoop' {Text
humanLoopName :: Text
$sel:humanLoopName:DescribeHumanLoop' :: DescribeHumanLoop -> 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 DescribeHumanLoop where
  toQuery :: DescribeHumanLoop -> QueryString
toQuery = QueryString -> DescribeHumanLoop -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeHumanLoopResponse' smart constructor.
data DescribeHumanLoopResponse = DescribeHumanLoopResponse'
  { -- | The reason why a human loop failed. The failure reason is returned when
    -- the status of the human loop is @Failed@.
    DescribeHumanLoopResponse -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | A failure code that identifies the type of failure.
    --
    -- Possible values: @ValidationError@, @Expired@, @InternalError@
    DescribeHumanLoopResponse -> Maybe Text
failureCode :: Prelude.Maybe Prelude.Text,
    -- | An object that contains information about the output of the human loop.
    DescribeHumanLoopResponse -> Maybe HumanLoopOutput
humanLoopOutput :: Prelude.Maybe HumanLoopOutput,
    -- | The response's http status code.
    DescribeHumanLoopResponse -> Int
httpStatus :: Prelude.Int,
    -- | The creation time when Amazon Augmented AI created the human loop.
    DescribeHumanLoopResponse -> POSIX
creationTime :: Core.POSIX,
    -- | The status of the human loop.
    DescribeHumanLoopResponse -> HumanLoopStatus
humanLoopStatus :: HumanLoopStatus,
    -- | The name of the human loop. The name must be lowercase, unique within
    -- the Region in your account, and can have up to 63 characters. Valid
    -- characters: a-z, 0-9, and - (hyphen).
    DescribeHumanLoopResponse -> Text
humanLoopName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the human loop.
    DescribeHumanLoopResponse -> Text
humanLoopArn :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the flow definition.
    DescribeHumanLoopResponse -> Text
flowDefinitionArn :: Prelude.Text
  }
  deriving (DescribeHumanLoopResponse -> DescribeHumanLoopResponse -> Bool
(DescribeHumanLoopResponse -> DescribeHumanLoopResponse -> Bool)
-> (DescribeHumanLoopResponse -> DescribeHumanLoopResponse -> Bool)
-> Eq DescribeHumanLoopResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHumanLoopResponse -> DescribeHumanLoopResponse -> Bool
$c/= :: DescribeHumanLoopResponse -> DescribeHumanLoopResponse -> Bool
== :: DescribeHumanLoopResponse -> DescribeHumanLoopResponse -> Bool
$c== :: DescribeHumanLoopResponse -> DescribeHumanLoopResponse -> Bool
Prelude.Eq, ReadPrec [DescribeHumanLoopResponse]
ReadPrec DescribeHumanLoopResponse
Int -> ReadS DescribeHumanLoopResponse
ReadS [DescribeHumanLoopResponse]
(Int -> ReadS DescribeHumanLoopResponse)
-> ReadS [DescribeHumanLoopResponse]
-> ReadPrec DescribeHumanLoopResponse
-> ReadPrec [DescribeHumanLoopResponse]
-> Read DescribeHumanLoopResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHumanLoopResponse]
$creadListPrec :: ReadPrec [DescribeHumanLoopResponse]
readPrec :: ReadPrec DescribeHumanLoopResponse
$creadPrec :: ReadPrec DescribeHumanLoopResponse
readList :: ReadS [DescribeHumanLoopResponse]
$creadList :: ReadS [DescribeHumanLoopResponse]
readsPrec :: Int -> ReadS DescribeHumanLoopResponse
$creadsPrec :: Int -> ReadS DescribeHumanLoopResponse
Prelude.Read, Int -> DescribeHumanLoopResponse -> ShowS
[DescribeHumanLoopResponse] -> ShowS
DescribeHumanLoopResponse -> String
(Int -> DescribeHumanLoopResponse -> ShowS)
-> (DescribeHumanLoopResponse -> String)
-> ([DescribeHumanLoopResponse] -> ShowS)
-> Show DescribeHumanLoopResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHumanLoopResponse] -> ShowS
$cshowList :: [DescribeHumanLoopResponse] -> ShowS
show :: DescribeHumanLoopResponse -> String
$cshow :: DescribeHumanLoopResponse -> String
showsPrec :: Int -> DescribeHumanLoopResponse -> ShowS
$cshowsPrec :: Int -> DescribeHumanLoopResponse -> ShowS
Prelude.Show, (forall x.
 DescribeHumanLoopResponse -> Rep DescribeHumanLoopResponse x)
-> (forall x.
    Rep DescribeHumanLoopResponse x -> DescribeHumanLoopResponse)
-> Generic DescribeHumanLoopResponse
forall x.
Rep DescribeHumanLoopResponse x -> DescribeHumanLoopResponse
forall x.
DescribeHumanLoopResponse -> Rep DescribeHumanLoopResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeHumanLoopResponse x -> DescribeHumanLoopResponse
$cfrom :: forall x.
DescribeHumanLoopResponse -> Rep DescribeHumanLoopResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeHumanLoopResponse' 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:
--
-- 'failureReason', 'describeHumanLoopResponse_failureReason' - The reason why a human loop failed. The failure reason is returned when
-- the status of the human loop is @Failed@.
--
-- 'failureCode', 'describeHumanLoopResponse_failureCode' - A failure code that identifies the type of failure.
--
-- Possible values: @ValidationError@, @Expired@, @InternalError@
--
-- 'humanLoopOutput', 'describeHumanLoopResponse_humanLoopOutput' - An object that contains information about the output of the human loop.
--
-- 'httpStatus', 'describeHumanLoopResponse_httpStatus' - The response's http status code.
--
-- 'creationTime', 'describeHumanLoopResponse_creationTime' - The creation time when Amazon Augmented AI created the human loop.
--
-- 'humanLoopStatus', 'describeHumanLoopResponse_humanLoopStatus' - The status of the human loop.
--
-- 'humanLoopName', 'describeHumanLoopResponse_humanLoopName' - The name of the human loop. The name must be lowercase, unique within
-- the Region in your account, and can have up to 63 characters. Valid
-- characters: a-z, 0-9, and - (hyphen).
--
-- 'humanLoopArn', 'describeHumanLoopResponse_humanLoopArn' - The Amazon Resource Name (ARN) of the human loop.
--
-- 'flowDefinitionArn', 'describeHumanLoopResponse_flowDefinitionArn' - The Amazon Resource Name (ARN) of the flow definition.
newDescribeHumanLoopResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'humanLoopStatus'
  HumanLoopStatus ->
  -- | 'humanLoopName'
  Prelude.Text ->
  -- | 'humanLoopArn'
  Prelude.Text ->
  -- | 'flowDefinitionArn'
  Prelude.Text ->
  DescribeHumanLoopResponse
newDescribeHumanLoopResponse :: Int
-> UTCTime
-> HumanLoopStatus
-> Text
-> Text
-> Text
-> DescribeHumanLoopResponse
newDescribeHumanLoopResponse
  Int
pHttpStatus_
  UTCTime
pCreationTime_
  HumanLoopStatus
pHumanLoopStatus_
  Text
pHumanLoopName_
  Text
pHumanLoopArn_
  Text
pFlowDefinitionArn_ =
    DescribeHumanLoopResponse' :: Maybe Text
-> Maybe Text
-> Maybe HumanLoopOutput
-> Int
-> POSIX
-> HumanLoopStatus
-> Text
-> Text
-> Text
-> DescribeHumanLoopResponse
DescribeHumanLoopResponse'
      { $sel:failureReason:DescribeHumanLoopResponse' :: Maybe Text
failureReason =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:failureCode:DescribeHumanLoopResponse' :: Maybe Text
failureCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:humanLoopOutput:DescribeHumanLoopResponse' :: Maybe HumanLoopOutput
humanLoopOutput = Maybe HumanLoopOutput
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeHumanLoopResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:creationTime:DescribeHumanLoopResponse' :: POSIX
creationTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:humanLoopStatus:DescribeHumanLoopResponse' :: HumanLoopStatus
humanLoopStatus = HumanLoopStatus
pHumanLoopStatus_,
        $sel:humanLoopName:DescribeHumanLoopResponse' :: Text
humanLoopName = Text
pHumanLoopName_,
        $sel:humanLoopArn:DescribeHumanLoopResponse' :: Text
humanLoopArn = Text
pHumanLoopArn_,
        $sel:flowDefinitionArn:DescribeHumanLoopResponse' :: Text
flowDefinitionArn = Text
pFlowDefinitionArn_
      }

-- | The reason why a human loop failed. The failure reason is returned when
-- the status of the human loop is @Failed@.
describeHumanLoopResponse_failureReason :: Lens.Lens' DescribeHumanLoopResponse (Prelude.Maybe Prelude.Text)
describeHumanLoopResponse_failureReason :: (Maybe Text -> f (Maybe Text))
-> DescribeHumanLoopResponse -> f DescribeHumanLoopResponse
describeHumanLoopResponse_failureReason = (DescribeHumanLoopResponse -> Maybe Text)
-> (DescribeHumanLoopResponse
    -> Maybe Text -> DescribeHumanLoopResponse)
-> Lens
     DescribeHumanLoopResponse
     DescribeHumanLoopResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHumanLoopResponse' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:DescribeHumanLoopResponse' :: DescribeHumanLoopResponse -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: DescribeHumanLoopResponse
s@DescribeHumanLoopResponse' {} Maybe Text
a -> DescribeHumanLoopResponse
s {$sel:failureReason:DescribeHumanLoopResponse' :: Maybe Text
failureReason = Maybe Text
a} :: DescribeHumanLoopResponse)

-- | A failure code that identifies the type of failure.
--
-- Possible values: @ValidationError@, @Expired@, @InternalError@
describeHumanLoopResponse_failureCode :: Lens.Lens' DescribeHumanLoopResponse (Prelude.Maybe Prelude.Text)
describeHumanLoopResponse_failureCode :: (Maybe Text -> f (Maybe Text))
-> DescribeHumanLoopResponse -> f DescribeHumanLoopResponse
describeHumanLoopResponse_failureCode = (DescribeHumanLoopResponse -> Maybe Text)
-> (DescribeHumanLoopResponse
    -> Maybe Text -> DescribeHumanLoopResponse)
-> Lens
     DescribeHumanLoopResponse
     DescribeHumanLoopResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHumanLoopResponse' {Maybe Text
failureCode :: Maybe Text
$sel:failureCode:DescribeHumanLoopResponse' :: DescribeHumanLoopResponse -> Maybe Text
failureCode} -> Maybe Text
failureCode) (\s :: DescribeHumanLoopResponse
s@DescribeHumanLoopResponse' {} Maybe Text
a -> DescribeHumanLoopResponse
s {$sel:failureCode:DescribeHumanLoopResponse' :: Maybe Text
failureCode = Maybe Text
a} :: DescribeHumanLoopResponse)

-- | An object that contains information about the output of the human loop.
describeHumanLoopResponse_humanLoopOutput :: Lens.Lens' DescribeHumanLoopResponse (Prelude.Maybe HumanLoopOutput)
describeHumanLoopResponse_humanLoopOutput :: (Maybe HumanLoopOutput -> f (Maybe HumanLoopOutput))
-> DescribeHumanLoopResponse -> f DescribeHumanLoopResponse
describeHumanLoopResponse_humanLoopOutput = (DescribeHumanLoopResponse -> Maybe HumanLoopOutput)
-> (DescribeHumanLoopResponse
    -> Maybe HumanLoopOutput -> DescribeHumanLoopResponse)
-> Lens
     DescribeHumanLoopResponse
     DescribeHumanLoopResponse
     (Maybe HumanLoopOutput)
     (Maybe HumanLoopOutput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHumanLoopResponse' {Maybe HumanLoopOutput
humanLoopOutput :: Maybe HumanLoopOutput
$sel:humanLoopOutput:DescribeHumanLoopResponse' :: DescribeHumanLoopResponse -> Maybe HumanLoopOutput
humanLoopOutput} -> Maybe HumanLoopOutput
humanLoopOutput) (\s :: DescribeHumanLoopResponse
s@DescribeHumanLoopResponse' {} Maybe HumanLoopOutput
a -> DescribeHumanLoopResponse
s {$sel:humanLoopOutput:DescribeHumanLoopResponse' :: Maybe HumanLoopOutput
humanLoopOutput = Maybe HumanLoopOutput
a} :: DescribeHumanLoopResponse)

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

-- | The creation time when Amazon Augmented AI created the human loop.
describeHumanLoopResponse_creationTime :: Lens.Lens' DescribeHumanLoopResponse Prelude.UTCTime
describeHumanLoopResponse_creationTime :: (UTCTime -> f UTCTime)
-> DescribeHumanLoopResponse -> f DescribeHumanLoopResponse
describeHumanLoopResponse_creationTime = (DescribeHumanLoopResponse -> POSIX)
-> (DescribeHumanLoopResponse
    -> POSIX -> DescribeHumanLoopResponse)
-> Lens
     DescribeHumanLoopResponse DescribeHumanLoopResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHumanLoopResponse' {POSIX
creationTime :: POSIX
$sel:creationTime:DescribeHumanLoopResponse' :: DescribeHumanLoopResponse -> POSIX
creationTime} -> POSIX
creationTime) (\s :: DescribeHumanLoopResponse
s@DescribeHumanLoopResponse' {} POSIX
a -> DescribeHumanLoopResponse
s {$sel:creationTime:DescribeHumanLoopResponse' :: POSIX
creationTime = POSIX
a} :: DescribeHumanLoopResponse) ((POSIX -> f POSIX)
 -> DescribeHumanLoopResponse -> f DescribeHumanLoopResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DescribeHumanLoopResponse
-> f DescribeHumanLoopResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The status of the human loop.
describeHumanLoopResponse_humanLoopStatus :: Lens.Lens' DescribeHumanLoopResponse HumanLoopStatus
describeHumanLoopResponse_humanLoopStatus :: (HumanLoopStatus -> f HumanLoopStatus)
-> DescribeHumanLoopResponse -> f DescribeHumanLoopResponse
describeHumanLoopResponse_humanLoopStatus = (DescribeHumanLoopResponse -> HumanLoopStatus)
-> (DescribeHumanLoopResponse
    -> HumanLoopStatus -> DescribeHumanLoopResponse)
-> Lens
     DescribeHumanLoopResponse
     DescribeHumanLoopResponse
     HumanLoopStatus
     HumanLoopStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHumanLoopResponse' {HumanLoopStatus
humanLoopStatus :: HumanLoopStatus
$sel:humanLoopStatus:DescribeHumanLoopResponse' :: DescribeHumanLoopResponse -> HumanLoopStatus
humanLoopStatus} -> HumanLoopStatus
humanLoopStatus) (\s :: DescribeHumanLoopResponse
s@DescribeHumanLoopResponse' {} HumanLoopStatus
a -> DescribeHumanLoopResponse
s {$sel:humanLoopStatus:DescribeHumanLoopResponse' :: HumanLoopStatus
humanLoopStatus = HumanLoopStatus
a} :: DescribeHumanLoopResponse)

-- | The name of the human loop. The name must be lowercase, unique within
-- the Region in your account, and can have up to 63 characters. Valid
-- characters: a-z, 0-9, and - (hyphen).
describeHumanLoopResponse_humanLoopName :: Lens.Lens' DescribeHumanLoopResponse Prelude.Text
describeHumanLoopResponse_humanLoopName :: (Text -> f Text)
-> DescribeHumanLoopResponse -> f DescribeHumanLoopResponse
describeHumanLoopResponse_humanLoopName = (DescribeHumanLoopResponse -> Text)
-> (DescribeHumanLoopResponse -> Text -> DescribeHumanLoopResponse)
-> Lens
     DescribeHumanLoopResponse DescribeHumanLoopResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHumanLoopResponse' {Text
humanLoopName :: Text
$sel:humanLoopName:DescribeHumanLoopResponse' :: DescribeHumanLoopResponse -> Text
humanLoopName} -> Text
humanLoopName) (\s :: DescribeHumanLoopResponse
s@DescribeHumanLoopResponse' {} Text
a -> DescribeHumanLoopResponse
s {$sel:humanLoopName:DescribeHumanLoopResponse' :: Text
humanLoopName = Text
a} :: DescribeHumanLoopResponse)

-- | The Amazon Resource Name (ARN) of the human loop.
describeHumanLoopResponse_humanLoopArn :: Lens.Lens' DescribeHumanLoopResponse Prelude.Text
describeHumanLoopResponse_humanLoopArn :: (Text -> f Text)
-> DescribeHumanLoopResponse -> f DescribeHumanLoopResponse
describeHumanLoopResponse_humanLoopArn = (DescribeHumanLoopResponse -> Text)
-> (DescribeHumanLoopResponse -> Text -> DescribeHumanLoopResponse)
-> Lens
     DescribeHumanLoopResponse DescribeHumanLoopResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHumanLoopResponse' {Text
humanLoopArn :: Text
$sel:humanLoopArn:DescribeHumanLoopResponse' :: DescribeHumanLoopResponse -> Text
humanLoopArn} -> Text
humanLoopArn) (\s :: DescribeHumanLoopResponse
s@DescribeHumanLoopResponse' {} Text
a -> DescribeHumanLoopResponse
s {$sel:humanLoopArn:DescribeHumanLoopResponse' :: Text
humanLoopArn = Text
a} :: DescribeHumanLoopResponse)

-- | The Amazon Resource Name (ARN) of the flow definition.
describeHumanLoopResponse_flowDefinitionArn :: Lens.Lens' DescribeHumanLoopResponse Prelude.Text
describeHumanLoopResponse_flowDefinitionArn :: (Text -> f Text)
-> DescribeHumanLoopResponse -> f DescribeHumanLoopResponse
describeHumanLoopResponse_flowDefinitionArn = (DescribeHumanLoopResponse -> Text)
-> (DescribeHumanLoopResponse -> Text -> DescribeHumanLoopResponse)
-> Lens
     DescribeHumanLoopResponse DescribeHumanLoopResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHumanLoopResponse' {Text
flowDefinitionArn :: Text
$sel:flowDefinitionArn:DescribeHumanLoopResponse' :: DescribeHumanLoopResponse -> Text
flowDefinitionArn} -> Text
flowDefinitionArn) (\s :: DescribeHumanLoopResponse
s@DescribeHumanLoopResponse' {} Text
a -> DescribeHumanLoopResponse
s {$sel:flowDefinitionArn:DescribeHumanLoopResponse' :: Text
flowDefinitionArn = Text
a} :: DescribeHumanLoopResponse)

instance Prelude.NFData DescribeHumanLoopResponse