{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.HumanLoopRequestSource 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.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
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]
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
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. 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'
      { $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 :: Lens' HumanLoopRequestSource AwsManagedHumanLoopRequestSource
humanLoopRequestSource_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 Data.FromJSON HumanLoopRequestSource where
  parseJSON :: Value -> Parser HumanLoopRequestSource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HumanLoopRequestSource"
      ( \Object
x ->
          AwsManagedHumanLoopRequestSource -> HumanLoopRequestSource
HumanLoopRequestSource'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AwsManagedHumanLoopRequestSource")
      )

instance Prelude.Hashable HumanLoopRequestSource where
  hashWithSalt :: Int -> HumanLoopRequestSource -> Int
hashWithSalt Int
_salt HumanLoopRequestSource' {AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource :: AwsManagedHumanLoopRequestSource
$sel:awsManagedHumanLoopRequestSource:HumanLoopRequestSource' :: HumanLoopRequestSource -> AwsManagedHumanLoopRequestSource
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource

instance Prelude.NFData HumanLoopRequestSource where
  rnf :: HumanLoopRequestSource -> ()
rnf HumanLoopRequestSource' {AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource :: AwsManagedHumanLoopRequestSource
$sel:awsManagedHumanLoopRequestSource:HumanLoopRequestSource' :: HumanLoopRequestSource -> AwsManagedHumanLoopRequestSource
..} =
    forall a. NFData a => a -> ()
Prelude.rnf AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource

instance Data.ToJSON HumanLoopRequestSource where
  toJSON :: HumanLoopRequestSource -> Value
toJSON HumanLoopRequestSource' {AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource :: AwsManagedHumanLoopRequestSource
$sel:awsManagedHumanLoopRequestSource:HumanLoopRequestSource' :: HumanLoopRequestSource -> AwsManagedHumanLoopRequestSource
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"AwsManagedHumanLoopRequestSource"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AwsManagedHumanLoopRequestSource
awsManagedHumanLoopRequestSource
              )
          ]
      )