{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.HumanLoopSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMakerA2IRuntime.Types.HumanLoopSummary 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 Amazonka.SageMakerA2IRuntime.Types.HumanLoopStatus

-- | Summary information about the human loop.
--
-- /See:/ 'newHumanLoopSummary' smart constructor.
data HumanLoopSummary = HumanLoopSummary'
  { -- | When Amazon Augmented AI created the human loop.
    HumanLoopSummary -> Maybe ISO8601
creationTime :: Prelude.Maybe Data.ISO8601,
    -- | The reason why the human loop failed. A failure reason is returned when
    -- the status of the human loop is @Failed@.
    HumanLoopSummary -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the flow definition used to configure
    -- the human loop.
    HumanLoopSummary -> Maybe Text
flowDefinitionArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the human loop.
    HumanLoopSummary -> Maybe Text
humanLoopName :: Prelude.Maybe Prelude.Text,
    -- | The status of the human loop.
    HumanLoopSummary -> Maybe HumanLoopStatus
humanLoopStatus :: Prelude.Maybe HumanLoopStatus
  }
  deriving (HumanLoopSummary -> HumanLoopSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HumanLoopSummary -> HumanLoopSummary -> Bool
$c/= :: HumanLoopSummary -> HumanLoopSummary -> Bool
== :: HumanLoopSummary -> HumanLoopSummary -> Bool
$c== :: HumanLoopSummary -> HumanLoopSummary -> Bool
Prelude.Eq, ReadPrec [HumanLoopSummary]
ReadPrec HumanLoopSummary
Int -> ReadS HumanLoopSummary
ReadS [HumanLoopSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HumanLoopSummary]
$creadListPrec :: ReadPrec [HumanLoopSummary]
readPrec :: ReadPrec HumanLoopSummary
$creadPrec :: ReadPrec HumanLoopSummary
readList :: ReadS [HumanLoopSummary]
$creadList :: ReadS [HumanLoopSummary]
readsPrec :: Int -> ReadS HumanLoopSummary
$creadsPrec :: Int -> ReadS HumanLoopSummary
Prelude.Read, Int -> HumanLoopSummary -> ShowS
[HumanLoopSummary] -> ShowS
HumanLoopSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HumanLoopSummary] -> ShowS
$cshowList :: [HumanLoopSummary] -> ShowS
show :: HumanLoopSummary -> String
$cshow :: HumanLoopSummary -> String
showsPrec :: Int -> HumanLoopSummary -> ShowS
$cshowsPrec :: Int -> HumanLoopSummary -> ShowS
Prelude.Show, forall x. Rep HumanLoopSummary x -> HumanLoopSummary
forall x. HumanLoopSummary -> Rep HumanLoopSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HumanLoopSummary x -> HumanLoopSummary
$cfrom :: forall x. HumanLoopSummary -> Rep HumanLoopSummary x
Prelude.Generic)

-- |
-- Create a value of 'HumanLoopSummary' 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:
--
-- 'creationTime', 'humanLoopSummary_creationTime' - When Amazon Augmented AI created the human loop.
--
-- 'failureReason', 'humanLoopSummary_failureReason' - The reason why the human loop failed. A failure reason is returned when
-- the status of the human loop is @Failed@.
--
-- 'flowDefinitionArn', 'humanLoopSummary_flowDefinitionArn' - The Amazon Resource Name (ARN) of the flow definition used to configure
-- the human loop.
--
-- 'humanLoopName', 'humanLoopSummary_humanLoopName' - The name of the human loop.
--
-- 'humanLoopStatus', 'humanLoopSummary_humanLoopStatus' - The status of the human loop.
newHumanLoopSummary ::
  HumanLoopSummary
newHumanLoopSummary :: HumanLoopSummary
newHumanLoopSummary =
  HumanLoopSummary'
    { $sel:creationTime:HumanLoopSummary' :: Maybe ISO8601
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:failureReason:HumanLoopSummary' :: Maybe Text
failureReason = forall a. Maybe a
Prelude.Nothing,
      $sel:flowDefinitionArn:HumanLoopSummary' :: Maybe Text
flowDefinitionArn = forall a. Maybe a
Prelude.Nothing,
      $sel:humanLoopName:HumanLoopSummary' :: Maybe Text
humanLoopName = forall a. Maybe a
Prelude.Nothing,
      $sel:humanLoopStatus:HumanLoopSummary' :: Maybe HumanLoopStatus
humanLoopStatus = forall a. Maybe a
Prelude.Nothing
    }

-- | When Amazon Augmented AI created the human loop.
humanLoopSummary_creationTime :: Lens.Lens' HumanLoopSummary (Prelude.Maybe Prelude.UTCTime)
humanLoopSummary_creationTime :: Lens' HumanLoopSummary (Maybe UTCTime)
humanLoopSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopSummary' {Maybe ISO8601
creationTime :: Maybe ISO8601
$sel:creationTime:HumanLoopSummary' :: HumanLoopSummary -> Maybe ISO8601
creationTime} -> Maybe ISO8601
creationTime) (\s :: HumanLoopSummary
s@HumanLoopSummary' {} Maybe ISO8601
a -> HumanLoopSummary
s {$sel:creationTime:HumanLoopSummary' :: Maybe ISO8601
creationTime = Maybe ISO8601
a} :: HumanLoopSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

-- | The Amazon Resource Name (ARN) of the flow definition used to configure
-- the human loop.
humanLoopSummary_flowDefinitionArn :: Lens.Lens' HumanLoopSummary (Prelude.Maybe Prelude.Text)
humanLoopSummary_flowDefinitionArn :: Lens' HumanLoopSummary (Maybe Text)
humanLoopSummary_flowDefinitionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopSummary' {Maybe Text
flowDefinitionArn :: Maybe Text
$sel:flowDefinitionArn:HumanLoopSummary' :: HumanLoopSummary -> Maybe Text
flowDefinitionArn} -> Maybe Text
flowDefinitionArn) (\s :: HumanLoopSummary
s@HumanLoopSummary' {} Maybe Text
a -> HumanLoopSummary
s {$sel:flowDefinitionArn:HumanLoopSummary' :: Maybe Text
flowDefinitionArn = Maybe Text
a} :: HumanLoopSummary)

-- | The name of the human loop.
humanLoopSummary_humanLoopName :: Lens.Lens' HumanLoopSummary (Prelude.Maybe Prelude.Text)
humanLoopSummary_humanLoopName :: Lens' HumanLoopSummary (Maybe Text)
humanLoopSummary_humanLoopName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopSummary' {Maybe Text
humanLoopName :: Maybe Text
$sel:humanLoopName:HumanLoopSummary' :: HumanLoopSummary -> Maybe Text
humanLoopName} -> Maybe Text
humanLoopName) (\s :: HumanLoopSummary
s@HumanLoopSummary' {} Maybe Text
a -> HumanLoopSummary
s {$sel:humanLoopName:HumanLoopSummary' :: Maybe Text
humanLoopName = Maybe Text
a} :: HumanLoopSummary)

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

instance Data.FromJSON HumanLoopSummary where
  parseJSON :: Value -> Parser HumanLoopSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HumanLoopSummary"
      ( \Object
x ->
          Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe HumanLoopStatus
-> HumanLoopSummary
HumanLoopSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FailureReason")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FlowDefinitionArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HumanLoopName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HumanLoopStatus")
      )

instance Prelude.Hashable HumanLoopSummary where
  hashWithSalt :: Int -> HumanLoopSummary -> Int
hashWithSalt Int
_salt HumanLoopSummary' {Maybe Text
Maybe ISO8601
Maybe HumanLoopStatus
humanLoopStatus :: Maybe HumanLoopStatus
humanLoopName :: Maybe Text
flowDefinitionArn :: Maybe Text
failureReason :: Maybe Text
creationTime :: Maybe ISO8601
$sel:humanLoopStatus:HumanLoopSummary' :: HumanLoopSummary -> Maybe HumanLoopStatus
$sel:humanLoopName:HumanLoopSummary' :: HumanLoopSummary -> Maybe Text
$sel:flowDefinitionArn:HumanLoopSummary' :: HumanLoopSummary -> Maybe Text
$sel:failureReason:HumanLoopSummary' :: HumanLoopSummary -> Maybe Text
$sel:creationTime:HumanLoopSummary' :: HumanLoopSummary -> Maybe ISO8601
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
failureReason
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
flowDefinitionArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
humanLoopName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HumanLoopStatus
humanLoopStatus

instance Prelude.NFData HumanLoopSummary where
  rnf :: HumanLoopSummary -> ()
rnf HumanLoopSummary' {Maybe Text
Maybe ISO8601
Maybe HumanLoopStatus
humanLoopStatus :: Maybe HumanLoopStatus
humanLoopName :: Maybe Text
flowDefinitionArn :: Maybe Text
failureReason :: Maybe Text
creationTime :: Maybe ISO8601
$sel:humanLoopStatus:HumanLoopSummary' :: HumanLoopSummary -> Maybe HumanLoopStatus
$sel:humanLoopName:HumanLoopSummary' :: HumanLoopSummary -> Maybe Text
$sel:flowDefinitionArn:HumanLoopSummary' :: HumanLoopSummary -> Maybe Text
$sel:failureReason:HumanLoopSummary' :: HumanLoopSummary -> Maybe Text
$sel:creationTime:HumanLoopSummary' :: HumanLoopSummary -> Maybe ISO8601
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
failureReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
flowDefinitionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
humanLoopName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HumanLoopStatus
humanLoopStatus