{-# 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.Rekognition.Types.HumanLoopActivationOutput
-- 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.Rekognition.Types.HumanLoopActivationOutput 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

-- | Shows the results of the human in the loop evaluation. If there is no
-- HumanLoopArn, the input did not trigger human review.
--
-- /See:/ 'newHumanLoopActivationOutput' smart constructor.
data HumanLoopActivationOutput = HumanLoopActivationOutput'
  { -- | Shows the result of condition evaluations, including those conditions
    -- which activated a human review.
    HumanLoopActivationOutput -> Maybe Text
humanLoopActivationConditionsEvaluationResults :: Prelude.Maybe Prelude.Text,
    -- | Shows if and why human review was needed.
    HumanLoopActivationOutput -> Maybe (NonEmpty Text)
humanLoopActivationReasons :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the HumanLoop created.
    HumanLoopActivationOutput -> Maybe Text
humanLoopArn :: Prelude.Maybe Prelude.Text
  }
  deriving (HumanLoopActivationOutput -> HumanLoopActivationOutput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HumanLoopActivationOutput -> HumanLoopActivationOutput -> Bool
$c/= :: HumanLoopActivationOutput -> HumanLoopActivationOutput -> Bool
== :: HumanLoopActivationOutput -> HumanLoopActivationOutput -> Bool
$c== :: HumanLoopActivationOutput -> HumanLoopActivationOutput -> Bool
Prelude.Eq, ReadPrec [HumanLoopActivationOutput]
ReadPrec HumanLoopActivationOutput
Int -> ReadS HumanLoopActivationOutput
ReadS [HumanLoopActivationOutput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HumanLoopActivationOutput]
$creadListPrec :: ReadPrec [HumanLoopActivationOutput]
readPrec :: ReadPrec HumanLoopActivationOutput
$creadPrec :: ReadPrec HumanLoopActivationOutput
readList :: ReadS [HumanLoopActivationOutput]
$creadList :: ReadS [HumanLoopActivationOutput]
readsPrec :: Int -> ReadS HumanLoopActivationOutput
$creadsPrec :: Int -> ReadS HumanLoopActivationOutput
Prelude.Read, Int -> HumanLoopActivationOutput -> ShowS
[HumanLoopActivationOutput] -> ShowS
HumanLoopActivationOutput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HumanLoopActivationOutput] -> ShowS
$cshowList :: [HumanLoopActivationOutput] -> ShowS
show :: HumanLoopActivationOutput -> String
$cshow :: HumanLoopActivationOutput -> String
showsPrec :: Int -> HumanLoopActivationOutput -> ShowS
$cshowsPrec :: Int -> HumanLoopActivationOutput -> ShowS
Prelude.Show, forall x.
Rep HumanLoopActivationOutput x -> HumanLoopActivationOutput
forall x.
HumanLoopActivationOutput -> Rep HumanLoopActivationOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HumanLoopActivationOutput x -> HumanLoopActivationOutput
$cfrom :: forall x.
HumanLoopActivationOutput -> Rep HumanLoopActivationOutput x
Prelude.Generic)

-- |
-- Create a value of 'HumanLoopActivationOutput' 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:
--
-- 'humanLoopActivationConditionsEvaluationResults', 'humanLoopActivationOutput_humanLoopActivationConditionsEvaluationResults' - Shows the result of condition evaluations, including those conditions
-- which activated a human review.
--
-- 'humanLoopActivationReasons', 'humanLoopActivationOutput_humanLoopActivationReasons' - Shows if and why human review was needed.
--
-- 'humanLoopArn', 'humanLoopActivationOutput_humanLoopArn' - The Amazon Resource Name (ARN) of the HumanLoop created.
newHumanLoopActivationOutput ::
  HumanLoopActivationOutput
newHumanLoopActivationOutput :: HumanLoopActivationOutput
newHumanLoopActivationOutput =
  HumanLoopActivationOutput'
    { $sel:humanLoopActivationConditionsEvaluationResults:HumanLoopActivationOutput' :: Maybe Text
humanLoopActivationConditionsEvaluationResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:humanLoopActivationReasons:HumanLoopActivationOutput' :: Maybe (NonEmpty Text)
humanLoopActivationReasons = forall a. Maybe a
Prelude.Nothing,
      $sel:humanLoopArn:HumanLoopActivationOutput' :: Maybe Text
humanLoopArn = forall a. Maybe a
Prelude.Nothing
    }

-- | Shows the result of condition evaluations, including those conditions
-- which activated a human review.
humanLoopActivationOutput_humanLoopActivationConditionsEvaluationResults :: Lens.Lens' HumanLoopActivationOutput (Prelude.Maybe Prelude.Text)
humanLoopActivationOutput_humanLoopActivationConditionsEvaluationResults :: Lens' HumanLoopActivationOutput (Maybe Text)
humanLoopActivationOutput_humanLoopActivationConditionsEvaluationResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopActivationOutput' {Maybe Text
humanLoopActivationConditionsEvaluationResults :: Maybe Text
$sel:humanLoopActivationConditionsEvaluationResults:HumanLoopActivationOutput' :: HumanLoopActivationOutput -> Maybe Text
humanLoopActivationConditionsEvaluationResults} -> Maybe Text
humanLoopActivationConditionsEvaluationResults) (\s :: HumanLoopActivationOutput
s@HumanLoopActivationOutput' {} Maybe Text
a -> HumanLoopActivationOutput
s {$sel:humanLoopActivationConditionsEvaluationResults:HumanLoopActivationOutput' :: Maybe Text
humanLoopActivationConditionsEvaluationResults = Maybe Text
a} :: HumanLoopActivationOutput)

-- | Shows if and why human review was needed.
humanLoopActivationOutput_humanLoopActivationReasons :: Lens.Lens' HumanLoopActivationOutput (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
humanLoopActivationOutput_humanLoopActivationReasons :: Lens' HumanLoopActivationOutput (Maybe (NonEmpty Text))
humanLoopActivationOutput_humanLoopActivationReasons = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopActivationOutput' {Maybe (NonEmpty Text)
humanLoopActivationReasons :: Maybe (NonEmpty Text)
$sel:humanLoopActivationReasons:HumanLoopActivationOutput' :: HumanLoopActivationOutput -> Maybe (NonEmpty Text)
humanLoopActivationReasons} -> Maybe (NonEmpty Text)
humanLoopActivationReasons) (\s :: HumanLoopActivationOutput
s@HumanLoopActivationOutput' {} Maybe (NonEmpty Text)
a -> HumanLoopActivationOutput
s {$sel:humanLoopActivationReasons:HumanLoopActivationOutput' :: Maybe (NonEmpty Text)
humanLoopActivationReasons = Maybe (NonEmpty Text)
a} :: HumanLoopActivationOutput) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the HumanLoop created.
humanLoopActivationOutput_humanLoopArn :: Lens.Lens' HumanLoopActivationOutput (Prelude.Maybe Prelude.Text)
humanLoopActivationOutput_humanLoopArn :: Lens' HumanLoopActivationOutput (Maybe Text)
humanLoopActivationOutput_humanLoopArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopActivationOutput' {Maybe Text
humanLoopArn :: Maybe Text
$sel:humanLoopArn:HumanLoopActivationOutput' :: HumanLoopActivationOutput -> Maybe Text
humanLoopArn} -> Maybe Text
humanLoopArn) (\s :: HumanLoopActivationOutput
s@HumanLoopActivationOutput' {} Maybe Text
a -> HumanLoopActivationOutput
s {$sel:humanLoopArn:HumanLoopActivationOutput' :: Maybe Text
humanLoopArn = Maybe Text
a} :: HumanLoopActivationOutput)

instance Data.FromJSON HumanLoopActivationOutput where
  parseJSON :: Value -> Parser HumanLoopActivationOutput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HumanLoopActivationOutput"
      ( \Object
x ->
          Maybe Text
-> Maybe (NonEmpty Text) -> Maybe Text -> HumanLoopActivationOutput
HumanLoopActivationOutput'
            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
"HumanLoopActivationConditionsEvaluationResults"
                        )
            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
"HumanLoopActivationReasons")
            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
"HumanLoopArn")
      )

instance Prelude.Hashable HumanLoopActivationOutput where
  hashWithSalt :: Int -> HumanLoopActivationOutput -> Int
hashWithSalt Int
_salt HumanLoopActivationOutput' {Maybe (NonEmpty Text)
Maybe Text
humanLoopArn :: Maybe Text
humanLoopActivationReasons :: Maybe (NonEmpty Text)
humanLoopActivationConditionsEvaluationResults :: Maybe Text
$sel:humanLoopArn:HumanLoopActivationOutput' :: HumanLoopActivationOutput -> Maybe Text
$sel:humanLoopActivationReasons:HumanLoopActivationOutput' :: HumanLoopActivationOutput -> Maybe (NonEmpty Text)
$sel:humanLoopActivationConditionsEvaluationResults:HumanLoopActivationOutput' :: HumanLoopActivationOutput -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
humanLoopActivationConditionsEvaluationResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
humanLoopActivationReasons
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
humanLoopArn

instance Prelude.NFData HumanLoopActivationOutput where
  rnf :: HumanLoopActivationOutput -> ()
rnf HumanLoopActivationOutput' {Maybe (NonEmpty Text)
Maybe Text
humanLoopArn :: Maybe Text
humanLoopActivationReasons :: Maybe (NonEmpty Text)
humanLoopActivationConditionsEvaluationResults :: Maybe Text
$sel:humanLoopArn:HumanLoopActivationOutput' :: HumanLoopActivationOutput -> Maybe Text
$sel:humanLoopActivationReasons:HumanLoopActivationOutput' :: HumanLoopActivationOutput -> Maybe (NonEmpty Text)
$sel:humanLoopActivationConditionsEvaluationResults:HumanLoopActivationOutput' :: HumanLoopActivationOutput -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf
      Maybe Text
humanLoopActivationConditionsEvaluationResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
humanLoopActivationReasons
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
humanLoopArn