{-# 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.HumanLoopConfig
-- 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.HumanLoopConfig where

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

-- | Describes the work to be performed by human workers.
--
-- /See:/ 'newHumanLoopConfig' smart constructor.
data HumanLoopConfig = HumanLoopConfig'
  { -- | Keywords used to describe the task so that workers can discover the
    -- task.
    HumanLoopConfig -> Maybe (NonEmpty Text)
taskKeywords :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    HumanLoopConfig -> Maybe PublicWorkforceTaskPrice
publicWorkforceTaskPrice :: Prelude.Maybe PublicWorkforceTaskPrice,
    -- | The amount of time that a worker has to complete a task. The default
    -- value is 3,600 seconds (1 hour).
    HumanLoopConfig -> Maybe Natural
taskTimeLimitInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The length of time that a task remains available for review by human
    -- workers.
    HumanLoopConfig -> Maybe Natural
taskAvailabilityLifetimeInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | Amazon Resource Name (ARN) of a team of workers. To learn more about the
    -- types of workforces and work teams you can create and use with Amazon
    -- A2I, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/sms-workforce-management.html Create and Manage Workforces>.
    HumanLoopConfig -> Text
workteamArn :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the human task user interface.
    --
    -- You can use standard HTML and Crowd HTML Elements to create a custom
    -- worker task template. You use this template to create a human task UI.
    --
    -- To learn how to create a custom HTML template, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/a2i-custom-templates.html Create Custom Worker Task Template>.
    --
    -- To learn how to create a human task UI, which is a worker task template
    -- that can be used in a flow definition, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/a2i-worker-template-console.html Create and Delete a Worker Task Templates>.
    HumanLoopConfig -> Text
humanTaskUiArn :: Prelude.Text,
    -- | A title for the human worker task.
    HumanLoopConfig -> Text
taskTitle :: Prelude.Text,
    -- | A description for the human worker task.
    HumanLoopConfig -> Text
taskDescription :: Prelude.Text,
    -- | The number of distinct workers who will perform the same task on each
    -- object. For example, if @TaskCount@ is set to @3@ for an image
    -- classification labeling job, three workers will classify each input
    -- image. Increasing @TaskCount@ can improve label accuracy.
    HumanLoopConfig -> Natural
taskCount :: Prelude.Natural
  }
  deriving (HumanLoopConfig -> HumanLoopConfig -> Bool
(HumanLoopConfig -> HumanLoopConfig -> Bool)
-> (HumanLoopConfig -> HumanLoopConfig -> Bool)
-> Eq HumanLoopConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HumanLoopConfig -> HumanLoopConfig -> Bool
$c/= :: HumanLoopConfig -> HumanLoopConfig -> Bool
== :: HumanLoopConfig -> HumanLoopConfig -> Bool
$c== :: HumanLoopConfig -> HumanLoopConfig -> Bool
Prelude.Eq, ReadPrec [HumanLoopConfig]
ReadPrec HumanLoopConfig
Int -> ReadS HumanLoopConfig
ReadS [HumanLoopConfig]
(Int -> ReadS HumanLoopConfig)
-> ReadS [HumanLoopConfig]
-> ReadPrec HumanLoopConfig
-> ReadPrec [HumanLoopConfig]
-> Read HumanLoopConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HumanLoopConfig]
$creadListPrec :: ReadPrec [HumanLoopConfig]
readPrec :: ReadPrec HumanLoopConfig
$creadPrec :: ReadPrec HumanLoopConfig
readList :: ReadS [HumanLoopConfig]
$creadList :: ReadS [HumanLoopConfig]
readsPrec :: Int -> ReadS HumanLoopConfig
$creadsPrec :: Int -> ReadS HumanLoopConfig
Prelude.Read, Int -> HumanLoopConfig -> ShowS
[HumanLoopConfig] -> ShowS
HumanLoopConfig -> String
(Int -> HumanLoopConfig -> ShowS)
-> (HumanLoopConfig -> String)
-> ([HumanLoopConfig] -> ShowS)
-> Show HumanLoopConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HumanLoopConfig] -> ShowS
$cshowList :: [HumanLoopConfig] -> ShowS
show :: HumanLoopConfig -> String
$cshow :: HumanLoopConfig -> String
showsPrec :: Int -> HumanLoopConfig -> ShowS
$cshowsPrec :: Int -> HumanLoopConfig -> ShowS
Prelude.Show, (forall x. HumanLoopConfig -> Rep HumanLoopConfig x)
-> (forall x. Rep HumanLoopConfig x -> HumanLoopConfig)
-> Generic HumanLoopConfig
forall x. Rep HumanLoopConfig x -> HumanLoopConfig
forall x. HumanLoopConfig -> Rep HumanLoopConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HumanLoopConfig x -> HumanLoopConfig
$cfrom :: forall x. HumanLoopConfig -> Rep HumanLoopConfig x
Prelude.Generic)

-- |
-- Create a value of 'HumanLoopConfig' 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:
--
-- 'taskKeywords', 'humanLoopConfig_taskKeywords' - Keywords used to describe the task so that workers can discover the
-- task.
--
-- 'publicWorkforceTaskPrice', 'humanLoopConfig_publicWorkforceTaskPrice' - Undocumented member.
--
-- 'taskTimeLimitInSeconds', 'humanLoopConfig_taskTimeLimitInSeconds' - The amount of time that a worker has to complete a task. The default
-- value is 3,600 seconds (1 hour).
--
-- 'taskAvailabilityLifetimeInSeconds', 'humanLoopConfig_taskAvailabilityLifetimeInSeconds' - The length of time that a task remains available for review by human
-- workers.
--
-- 'workteamArn', 'humanLoopConfig_workteamArn' - Amazon Resource Name (ARN) of a team of workers. To learn more about the
-- types of workforces and work teams you can create and use with Amazon
-- A2I, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sms-workforce-management.html Create and Manage Workforces>.
--
-- 'humanTaskUiArn', 'humanLoopConfig_humanTaskUiArn' - The Amazon Resource Name (ARN) of the human task user interface.
--
-- You can use standard HTML and Crowd HTML Elements to create a custom
-- worker task template. You use this template to create a human task UI.
--
-- To learn how to create a custom HTML template, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/a2i-custom-templates.html Create Custom Worker Task Template>.
--
-- To learn how to create a human task UI, which is a worker task template
-- that can be used in a flow definition, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/a2i-worker-template-console.html Create and Delete a Worker Task Templates>.
--
-- 'taskTitle', 'humanLoopConfig_taskTitle' - A title for the human worker task.
--
-- 'taskDescription', 'humanLoopConfig_taskDescription' - A description for the human worker task.
--
-- 'taskCount', 'humanLoopConfig_taskCount' - The number of distinct workers who will perform the same task on each
-- object. For example, if @TaskCount@ is set to @3@ for an image
-- classification labeling job, three workers will classify each input
-- image. Increasing @TaskCount@ can improve label accuracy.
newHumanLoopConfig ::
  -- | 'workteamArn'
  Prelude.Text ->
  -- | 'humanTaskUiArn'
  Prelude.Text ->
  -- | 'taskTitle'
  Prelude.Text ->
  -- | 'taskDescription'
  Prelude.Text ->
  -- | 'taskCount'
  Prelude.Natural ->
  HumanLoopConfig
newHumanLoopConfig :: Text -> Text -> Text -> Text -> Natural -> HumanLoopConfig
newHumanLoopConfig
  Text
pWorkteamArn_
  Text
pHumanTaskUiArn_
  Text
pTaskTitle_
  Text
pTaskDescription_
  Natural
pTaskCount_ =
    HumanLoopConfig' :: Maybe (NonEmpty Text)
-> Maybe PublicWorkforceTaskPrice
-> Maybe Natural
-> Maybe Natural
-> Text
-> Text
-> Text
-> Text
-> Natural
-> HumanLoopConfig
HumanLoopConfig'
      { $sel:taskKeywords:HumanLoopConfig' :: Maybe (NonEmpty Text)
taskKeywords = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:publicWorkforceTaskPrice:HumanLoopConfig' :: Maybe PublicWorkforceTaskPrice
publicWorkforceTaskPrice = Maybe PublicWorkforceTaskPrice
forall a. Maybe a
Prelude.Nothing,
        $sel:taskTimeLimitInSeconds:HumanLoopConfig' :: Maybe Natural
taskTimeLimitInSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:taskAvailabilityLifetimeInSeconds:HumanLoopConfig' :: Maybe Natural
taskAvailabilityLifetimeInSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:workteamArn:HumanLoopConfig' :: Text
workteamArn = Text
pWorkteamArn_,
        $sel:humanTaskUiArn:HumanLoopConfig' :: Text
humanTaskUiArn = Text
pHumanTaskUiArn_,
        $sel:taskTitle:HumanLoopConfig' :: Text
taskTitle = Text
pTaskTitle_,
        $sel:taskDescription:HumanLoopConfig' :: Text
taskDescription = Text
pTaskDescription_,
        $sel:taskCount:HumanLoopConfig' :: Natural
taskCount = Natural
pTaskCount_
      }

-- | Keywords used to describe the task so that workers can discover the
-- task.
humanLoopConfig_taskKeywords :: Lens.Lens' HumanLoopConfig (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
humanLoopConfig_taskKeywords :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_taskKeywords = (HumanLoopConfig -> Maybe (NonEmpty Text))
-> (HumanLoopConfig -> Maybe (NonEmpty Text) -> HumanLoopConfig)
-> Lens
     HumanLoopConfig
     HumanLoopConfig
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Maybe (NonEmpty Text)
taskKeywords :: Maybe (NonEmpty Text)
$sel:taskKeywords:HumanLoopConfig' :: HumanLoopConfig -> Maybe (NonEmpty Text)
taskKeywords} -> Maybe (NonEmpty Text)
taskKeywords) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Maybe (NonEmpty Text)
a -> HumanLoopConfig
s {$sel:taskKeywords:HumanLoopConfig' :: Maybe (NonEmpty Text)
taskKeywords = Maybe (NonEmpty Text)
a} :: HumanLoopConfig) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> HumanLoopConfig -> f HumanLoopConfig)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> HumanLoopConfig
-> f HumanLoopConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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 AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
humanLoopConfig_publicWorkforceTaskPrice :: Lens.Lens' HumanLoopConfig (Prelude.Maybe PublicWorkforceTaskPrice)
humanLoopConfig_publicWorkforceTaskPrice :: (Maybe PublicWorkforceTaskPrice
 -> f (Maybe PublicWorkforceTaskPrice))
-> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_publicWorkforceTaskPrice = (HumanLoopConfig -> Maybe PublicWorkforceTaskPrice)
-> (HumanLoopConfig
    -> Maybe PublicWorkforceTaskPrice -> HumanLoopConfig)
-> Lens
     HumanLoopConfig
     HumanLoopConfig
     (Maybe PublicWorkforceTaskPrice)
     (Maybe PublicWorkforceTaskPrice)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Maybe PublicWorkforceTaskPrice
publicWorkforceTaskPrice :: Maybe PublicWorkforceTaskPrice
$sel:publicWorkforceTaskPrice:HumanLoopConfig' :: HumanLoopConfig -> Maybe PublicWorkforceTaskPrice
publicWorkforceTaskPrice} -> Maybe PublicWorkforceTaskPrice
publicWorkforceTaskPrice) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Maybe PublicWorkforceTaskPrice
a -> HumanLoopConfig
s {$sel:publicWorkforceTaskPrice:HumanLoopConfig' :: Maybe PublicWorkforceTaskPrice
publicWorkforceTaskPrice = Maybe PublicWorkforceTaskPrice
a} :: HumanLoopConfig)

-- | The amount of time that a worker has to complete a task. The default
-- value is 3,600 seconds (1 hour).
humanLoopConfig_taskTimeLimitInSeconds :: Lens.Lens' HumanLoopConfig (Prelude.Maybe Prelude.Natural)
humanLoopConfig_taskTimeLimitInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_taskTimeLimitInSeconds = (HumanLoopConfig -> Maybe Natural)
-> (HumanLoopConfig -> Maybe Natural -> HumanLoopConfig)
-> Lens
     HumanLoopConfig HumanLoopConfig (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Maybe Natural
taskTimeLimitInSeconds :: Maybe Natural
$sel:taskTimeLimitInSeconds:HumanLoopConfig' :: HumanLoopConfig -> Maybe Natural
taskTimeLimitInSeconds} -> Maybe Natural
taskTimeLimitInSeconds) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Maybe Natural
a -> HumanLoopConfig
s {$sel:taskTimeLimitInSeconds:HumanLoopConfig' :: Maybe Natural
taskTimeLimitInSeconds = Maybe Natural
a} :: HumanLoopConfig)

-- | The length of time that a task remains available for review by human
-- workers.
humanLoopConfig_taskAvailabilityLifetimeInSeconds :: Lens.Lens' HumanLoopConfig (Prelude.Maybe Prelude.Natural)
humanLoopConfig_taskAvailabilityLifetimeInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_taskAvailabilityLifetimeInSeconds = (HumanLoopConfig -> Maybe Natural)
-> (HumanLoopConfig -> Maybe Natural -> HumanLoopConfig)
-> Lens
     HumanLoopConfig HumanLoopConfig (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Maybe Natural
taskAvailabilityLifetimeInSeconds :: Maybe Natural
$sel:taskAvailabilityLifetimeInSeconds:HumanLoopConfig' :: HumanLoopConfig -> Maybe Natural
taskAvailabilityLifetimeInSeconds} -> Maybe Natural
taskAvailabilityLifetimeInSeconds) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Maybe Natural
a -> HumanLoopConfig
s {$sel:taskAvailabilityLifetimeInSeconds:HumanLoopConfig' :: Maybe Natural
taskAvailabilityLifetimeInSeconds = Maybe Natural
a} :: HumanLoopConfig)

-- | Amazon Resource Name (ARN) of a team of workers. To learn more about the
-- types of workforces and work teams you can create and use with Amazon
-- A2I, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sms-workforce-management.html Create and Manage Workforces>.
humanLoopConfig_workteamArn :: Lens.Lens' HumanLoopConfig Prelude.Text
humanLoopConfig_workteamArn :: (Text -> f Text) -> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_workteamArn = (HumanLoopConfig -> Text)
-> (HumanLoopConfig -> Text -> HumanLoopConfig)
-> Lens HumanLoopConfig HumanLoopConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Text
workteamArn :: Text
$sel:workteamArn:HumanLoopConfig' :: HumanLoopConfig -> Text
workteamArn} -> Text
workteamArn) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Text
a -> HumanLoopConfig
s {$sel:workteamArn:HumanLoopConfig' :: Text
workteamArn = Text
a} :: HumanLoopConfig)

-- | The Amazon Resource Name (ARN) of the human task user interface.
--
-- You can use standard HTML and Crowd HTML Elements to create a custom
-- worker task template. You use this template to create a human task UI.
--
-- To learn how to create a custom HTML template, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/a2i-custom-templates.html Create Custom Worker Task Template>.
--
-- To learn how to create a human task UI, which is a worker task template
-- that can be used in a flow definition, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/a2i-worker-template-console.html Create and Delete a Worker Task Templates>.
humanLoopConfig_humanTaskUiArn :: Lens.Lens' HumanLoopConfig Prelude.Text
humanLoopConfig_humanTaskUiArn :: (Text -> f Text) -> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_humanTaskUiArn = (HumanLoopConfig -> Text)
-> (HumanLoopConfig -> Text -> HumanLoopConfig)
-> Lens HumanLoopConfig HumanLoopConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Text
humanTaskUiArn :: Text
$sel:humanTaskUiArn:HumanLoopConfig' :: HumanLoopConfig -> Text
humanTaskUiArn} -> Text
humanTaskUiArn) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Text
a -> HumanLoopConfig
s {$sel:humanTaskUiArn:HumanLoopConfig' :: Text
humanTaskUiArn = Text
a} :: HumanLoopConfig)

-- | A title for the human worker task.
humanLoopConfig_taskTitle :: Lens.Lens' HumanLoopConfig Prelude.Text
humanLoopConfig_taskTitle :: (Text -> f Text) -> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_taskTitle = (HumanLoopConfig -> Text)
-> (HumanLoopConfig -> Text -> HumanLoopConfig)
-> Lens HumanLoopConfig HumanLoopConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Text
taskTitle :: Text
$sel:taskTitle:HumanLoopConfig' :: HumanLoopConfig -> Text
taskTitle} -> Text
taskTitle) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Text
a -> HumanLoopConfig
s {$sel:taskTitle:HumanLoopConfig' :: Text
taskTitle = Text
a} :: HumanLoopConfig)

-- | A description for the human worker task.
humanLoopConfig_taskDescription :: Lens.Lens' HumanLoopConfig Prelude.Text
humanLoopConfig_taskDescription :: (Text -> f Text) -> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_taskDescription = (HumanLoopConfig -> Text)
-> (HumanLoopConfig -> Text -> HumanLoopConfig)
-> Lens HumanLoopConfig HumanLoopConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Text
taskDescription :: Text
$sel:taskDescription:HumanLoopConfig' :: HumanLoopConfig -> Text
taskDescription} -> Text
taskDescription) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Text
a -> HumanLoopConfig
s {$sel:taskDescription:HumanLoopConfig' :: Text
taskDescription = Text
a} :: HumanLoopConfig)

-- | The number of distinct workers who will perform the same task on each
-- object. For example, if @TaskCount@ is set to @3@ for an image
-- classification labeling job, three workers will classify each input
-- image. Increasing @TaskCount@ can improve label accuracy.
humanLoopConfig_taskCount :: Lens.Lens' HumanLoopConfig Prelude.Natural
humanLoopConfig_taskCount :: (Natural -> f Natural) -> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_taskCount = (HumanLoopConfig -> Natural)
-> (HumanLoopConfig -> Natural -> HumanLoopConfig)
-> Lens HumanLoopConfig HumanLoopConfig Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Natural
taskCount :: Natural
$sel:taskCount:HumanLoopConfig' :: HumanLoopConfig -> Natural
taskCount} -> Natural
taskCount) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Natural
a -> HumanLoopConfig
s {$sel:taskCount:HumanLoopConfig' :: Natural
taskCount = Natural
a} :: HumanLoopConfig)

instance Core.FromJSON HumanLoopConfig where
  parseJSON :: Value -> Parser HumanLoopConfig
parseJSON =
    String
-> (Object -> Parser HumanLoopConfig)
-> Value
-> Parser HumanLoopConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"HumanLoopConfig"
      ( \Object
x ->
          Maybe (NonEmpty Text)
-> Maybe PublicWorkforceTaskPrice
-> Maybe Natural
-> Maybe Natural
-> Text
-> Text
-> Text
-> Text
-> Natural
-> HumanLoopConfig
HumanLoopConfig'
            (Maybe (NonEmpty Text)
 -> Maybe PublicWorkforceTaskPrice
 -> Maybe Natural
 -> Maybe Natural
 -> Text
 -> Text
 -> Text
 -> Text
 -> Natural
 -> HumanLoopConfig)
-> Parser (Maybe (NonEmpty Text))
-> Parser
     (Maybe PublicWorkforceTaskPrice
      -> Maybe Natural
      -> Maybe Natural
      -> Text
      -> Text
      -> Text
      -> Text
      -> Natural
      -> HumanLoopConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TaskKeywords")
            Parser
  (Maybe PublicWorkforceTaskPrice
   -> Maybe Natural
   -> Maybe Natural
   -> Text
   -> Text
   -> Text
   -> Text
   -> Natural
   -> HumanLoopConfig)
-> Parser (Maybe PublicWorkforceTaskPrice)
-> Parser
     (Maybe Natural
      -> Maybe Natural
      -> Text
      -> Text
      -> Text
      -> Text
      -> Natural
      -> HumanLoopConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PublicWorkforceTaskPrice)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PublicWorkforceTaskPrice")
            Parser
  (Maybe Natural
   -> Maybe Natural
   -> Text
   -> Text
   -> Text
   -> Text
   -> Natural
   -> HumanLoopConfig)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Natural
      -> Text -> Text -> Text -> Text -> Natural -> HumanLoopConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TaskTimeLimitInSeconds")
            Parser
  (Maybe Natural
   -> Text -> Text -> Text -> Text -> Natural -> HumanLoopConfig)
-> Parser (Maybe Natural)
-> Parser
     (Text -> Text -> Text -> Text -> Natural -> HumanLoopConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TaskAvailabilityLifetimeInSeconds")
            Parser (Text -> Text -> Text -> Text -> Natural -> HumanLoopConfig)
-> Parser Text
-> Parser (Text -> Text -> Text -> Natural -> HumanLoopConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"WorkteamArn")
            Parser (Text -> Text -> Text -> Natural -> HumanLoopConfig)
-> Parser Text
-> Parser (Text -> Text -> Natural -> HumanLoopConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"HumanTaskUiArn")
            Parser (Text -> Text -> Natural -> HumanLoopConfig)
-> Parser Text -> Parser (Text -> Natural -> HumanLoopConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TaskTitle")
            Parser (Text -> Natural -> HumanLoopConfig)
-> Parser Text -> Parser (Natural -> HumanLoopConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TaskDescription")
            Parser (Natural -> HumanLoopConfig)
-> Parser Natural -> Parser HumanLoopConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TaskCount")
      )

instance Prelude.Hashable HumanLoopConfig

instance Prelude.NFData HumanLoopConfig

instance Core.ToJSON HumanLoopConfig where
  toJSON :: HumanLoopConfig -> Value
toJSON HumanLoopConfig' {Natural
Maybe Natural
Maybe (NonEmpty Text)
Maybe PublicWorkforceTaskPrice
Text
taskCount :: Natural
taskDescription :: Text
taskTitle :: Text
humanTaskUiArn :: Text
workteamArn :: Text
taskAvailabilityLifetimeInSeconds :: Maybe Natural
taskTimeLimitInSeconds :: Maybe Natural
publicWorkforceTaskPrice :: Maybe PublicWorkforceTaskPrice
taskKeywords :: Maybe (NonEmpty Text)
$sel:taskCount:HumanLoopConfig' :: HumanLoopConfig -> Natural
$sel:taskDescription:HumanLoopConfig' :: HumanLoopConfig -> Text
$sel:taskTitle:HumanLoopConfig' :: HumanLoopConfig -> Text
$sel:humanTaskUiArn:HumanLoopConfig' :: HumanLoopConfig -> Text
$sel:workteamArn:HumanLoopConfig' :: HumanLoopConfig -> Text
$sel:taskAvailabilityLifetimeInSeconds:HumanLoopConfig' :: HumanLoopConfig -> Maybe Natural
$sel:taskTimeLimitInSeconds:HumanLoopConfig' :: HumanLoopConfig -> Maybe Natural
$sel:publicWorkforceTaskPrice:HumanLoopConfig' :: HumanLoopConfig -> Maybe PublicWorkforceTaskPrice
$sel:taskKeywords:HumanLoopConfig' :: HumanLoopConfig -> Maybe (NonEmpty Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"TaskKeywords" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
taskKeywords,
            (Text
"PublicWorkforceTaskPrice" Text -> PublicWorkforceTaskPrice -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PublicWorkforceTaskPrice -> Pair)
-> Maybe PublicWorkforceTaskPrice -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PublicWorkforceTaskPrice
publicWorkforceTaskPrice,
            (Text
"TaskTimeLimitInSeconds" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
taskTimeLimitInSeconds,
            (Text
"TaskAvailabilityLifetimeInSeconds" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
taskAvailabilityLifetimeInSeconds,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WorkteamArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workteamArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"HumanTaskUiArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
humanTaskUiArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TaskTitle" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskTitle),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TaskDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskDescription),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TaskCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
taskCount)
          ]
      )