{-# 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.SageMaker.Types.HumanLoopRequestSource
-- 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)
module Amazonka.SageMaker.Types.HumanLoopRequestSource where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.AwsManagedHumanLoopRequestSource

-- | Container for configuring the source of human task requests.
--
-- /See:/ 'newHumanLoopRequestSource' smart constructor.
data HumanLoopRequestSource = HumanLoopRequestSource'
  { -- | Specifies whether Amazon Rekognition or Amazon Textract are used as the
    -- integration source. The default field settings and JSON parsing rules
    -- are different based on the integration source. Valid values:
    HumanLoopRequestSource -> AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource :: AwsManagedHumanLoopRequestSource
  }
  deriving (HumanLoopRequestSource -> HumanLoopRequestSource -> Bool
(HumanLoopRequestSource -> HumanLoopRequestSource -> Bool)
-> (HumanLoopRequestSource -> HumanLoopRequestSource -> Bool)
-> Eq HumanLoopRequestSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HumanLoopRequestSource -> HumanLoopRequestSource -> Bool
$c/= :: HumanLoopRequestSource -> HumanLoopRequestSource -> Bool
== :: HumanLoopRequestSource -> HumanLoopRequestSource -> Bool
$c== :: HumanLoopRequestSource -> HumanLoopRequestSource -> Bool
Prelude.Eq, ReadPrec [HumanLoopRequestSource]
ReadPrec HumanLoopRequestSource
Int -> ReadS HumanLoopRequestSource
ReadS [HumanLoopRequestSource]
(Int -> ReadS HumanLoopRequestSource)
-> ReadS [HumanLoopRequestSource]
-> ReadPrec HumanLoopRequestSource
-> ReadPrec [HumanLoopRequestSource]
-> Read HumanLoopRequestSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HumanLoopRequestSource]
$creadListPrec :: ReadPrec [HumanLoopRequestSource]
readPrec :: ReadPrec HumanLoopRequestSource
$creadPrec :: ReadPrec HumanLoopRequestSource
readList :: ReadS [HumanLoopRequestSource]
$creadList :: ReadS [HumanLoopRequestSource]
readsPrec :: Int -> ReadS HumanLoopRequestSource
$creadsPrec :: Int -> ReadS HumanLoopRequestSource
Prelude.Read, Int -> HumanLoopRequestSource -> ShowS
[HumanLoopRequestSource] -> ShowS
HumanLoopRequestSource -> String
(Int -> HumanLoopRequestSource -> ShowS)
-> (HumanLoopRequestSource -> String)
-> ([HumanLoopRequestSource] -> ShowS)
-> Show HumanLoopRequestSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HumanLoopRequestSource] -> ShowS
$cshowList :: [HumanLoopRequestSource] -> ShowS
show :: HumanLoopRequestSource -> String
$cshow :: HumanLoopRequestSource -> String
showsPrec :: Int -> HumanLoopRequestSource -> ShowS
$cshowsPrec :: Int -> HumanLoopRequestSource -> ShowS
Prelude.Show, (forall x. HumanLoopRequestSource -> Rep HumanLoopRequestSource x)
-> (forall x.
    Rep HumanLoopRequestSource x -> HumanLoopRequestSource)
-> Generic HumanLoopRequestSource
forall x. Rep HumanLoopRequestSource x -> HumanLoopRequestSource
forall x. HumanLoopRequestSource -> Rep HumanLoopRequestSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HumanLoopRequestSource x -> HumanLoopRequestSource
$cfrom :: forall x. HumanLoopRequestSource -> Rep HumanLoopRequestSource x
Prelude.Generic)

-- |
-- Create a value of 'HumanLoopRequestSource' 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:
--
-- 'awsManagedHumanLoopRequestSource', 'humanLoopRequestSource_awsManagedHumanLoopRequestSource' - Specifies whether Amazon Rekognition or Amazon Textract are used as the
-- integration source. The default field settings and JSON parsing rules
-- are different based on the integration source. Valid values:
newHumanLoopRequestSource ::
  -- | 'awsManagedHumanLoopRequestSource'
  AwsManagedHumanLoopRequestSource ->
  HumanLoopRequestSource
newHumanLoopRequestSource :: AwsManagedHumanLoopRequestSource -> HumanLoopRequestSource
newHumanLoopRequestSource
  AwsManagedHumanLoopRequestSource
pAwsManagedHumanLoopRequestSource_ =
    HumanLoopRequestSource' :: AwsManagedHumanLoopRequestSource -> HumanLoopRequestSource
HumanLoopRequestSource'
      { $sel:awsManagedHumanLoopRequestSource:HumanLoopRequestSource' :: AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource =
          AwsManagedHumanLoopRequestSource
pAwsManagedHumanLoopRequestSource_
      }

-- | Specifies whether Amazon Rekognition or Amazon Textract are used as the
-- integration source. The default field settings and JSON parsing rules
-- are different based on the integration source. Valid values:
humanLoopRequestSource_awsManagedHumanLoopRequestSource :: Lens.Lens' HumanLoopRequestSource AwsManagedHumanLoopRequestSource
humanLoopRequestSource_awsManagedHumanLoopRequestSource :: (AwsManagedHumanLoopRequestSource
 -> f AwsManagedHumanLoopRequestSource)
-> HumanLoopRequestSource -> f HumanLoopRequestSource
humanLoopRequestSource_awsManagedHumanLoopRequestSource = (HumanLoopRequestSource -> AwsManagedHumanLoopRequestSource)
-> (HumanLoopRequestSource
    -> AwsManagedHumanLoopRequestSource -> HumanLoopRequestSource)
-> Lens
     HumanLoopRequestSource
     HumanLoopRequestSource
     AwsManagedHumanLoopRequestSource
     AwsManagedHumanLoopRequestSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopRequestSource' {AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource :: AwsManagedHumanLoopRequestSource
$sel:awsManagedHumanLoopRequestSource:HumanLoopRequestSource' :: HumanLoopRequestSource -> AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource} -> AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource) (\s :: HumanLoopRequestSource
s@HumanLoopRequestSource' {} AwsManagedHumanLoopRequestSource
a -> HumanLoopRequestSource
s {$sel:awsManagedHumanLoopRequestSource:HumanLoopRequestSource' :: AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource = AwsManagedHumanLoopRequestSource
a} :: HumanLoopRequestSource)

instance Core.FromJSON HumanLoopRequestSource where
  parseJSON :: Value -> Parser HumanLoopRequestSource
parseJSON =
    String
-> (Object -> Parser HumanLoopRequestSource)
-> Value
-> Parser HumanLoopRequestSource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"HumanLoopRequestSource"
      ( \Object
x ->
          AwsManagedHumanLoopRequestSource -> HumanLoopRequestSource
HumanLoopRequestSource'
            (AwsManagedHumanLoopRequestSource -> HumanLoopRequestSource)
-> Parser AwsManagedHumanLoopRequestSource
-> Parser HumanLoopRequestSource
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser AwsManagedHumanLoopRequestSource
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AwsManagedHumanLoopRequestSource")
      )

instance Prelude.Hashable HumanLoopRequestSource

instance Prelude.NFData HumanLoopRequestSource

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