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

-- | Describes the work to be performed by human workers.
--
-- /See:/ 'newHumanLoopConfig' smart constructor.
data HumanLoopConfig = HumanLoopConfig'
  { HumanLoopConfig -> Maybe PublicWorkforceTaskPrice
publicWorkforceTaskPrice :: Prelude.Maybe PublicWorkforceTaskPrice,
    -- | The length of time that a task remains available for review by human
    -- workers.
    HumanLoopConfig -> Maybe Natural
taskAvailabilityLifetimeInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | Keywords used to describe the task so that workers can discover the
    -- task.
    HumanLoopConfig -> Maybe (NonEmpty Text)
taskKeywords :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | 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,
    -- | 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
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]
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
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. 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:
--
-- 'publicWorkforceTaskPrice', 'humanLoopConfig_publicWorkforceTaskPrice' - Undocumented member.
--
-- 'taskAvailabilityLifetimeInSeconds', 'humanLoopConfig_taskAvailabilityLifetimeInSeconds' - The length of time that a task remains available for review by human
-- workers.
--
-- 'taskKeywords', 'humanLoopConfig_taskKeywords' - Keywords used to describe the task so that workers can discover the
-- task.
--
-- 'taskTimeLimitInSeconds', 'humanLoopConfig_taskTimeLimitInSeconds' - The amount of time that a worker has to complete a task. The default
-- value is 3,600 seconds (1 hour).
--
-- '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'
      { $sel:publicWorkforceTaskPrice:HumanLoopConfig' :: Maybe PublicWorkforceTaskPrice
publicWorkforceTaskPrice =
          forall a. Maybe a
Prelude.Nothing,
        $sel:taskAvailabilityLifetimeInSeconds:HumanLoopConfig' :: Maybe Natural
taskAvailabilityLifetimeInSeconds = forall a. Maybe a
Prelude.Nothing,
        $sel:taskKeywords:HumanLoopConfig' :: Maybe (NonEmpty Text)
taskKeywords = forall a. Maybe a
Prelude.Nothing,
        $sel:taskTimeLimitInSeconds:HumanLoopConfig' :: Maybe Natural
taskTimeLimitInSeconds = 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_
      }

-- | Undocumented member.
humanLoopConfig_publicWorkforceTaskPrice :: Lens.Lens' HumanLoopConfig (Prelude.Maybe PublicWorkforceTaskPrice)
humanLoopConfig_publicWorkforceTaskPrice :: Lens' HumanLoopConfig (Maybe PublicWorkforceTaskPrice)
humanLoopConfig_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 length of time that a task remains available for review by human
-- workers.
humanLoopConfig_taskAvailabilityLifetimeInSeconds :: Lens.Lens' HumanLoopConfig (Prelude.Maybe Prelude.Natural)
humanLoopConfig_taskAvailabilityLifetimeInSeconds :: Lens' HumanLoopConfig (Maybe Natural)
humanLoopConfig_taskAvailabilityLifetimeInSeconds = 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)

-- | 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 :: Lens' HumanLoopConfig (Maybe (NonEmpty Text))
humanLoopConfig_taskKeywords = 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) 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 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 :: Lens' HumanLoopConfig (Maybe Natural)
humanLoopConfig_taskTimeLimitInSeconds = 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)

-- | 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 :: Lens' HumanLoopConfig Text
humanLoopConfig_workteamArn = 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 :: Lens' HumanLoopConfig Text
humanLoopConfig_humanTaskUiArn = 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 :: Lens' HumanLoopConfig Text
humanLoopConfig_taskTitle = 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 :: Lens' HumanLoopConfig Text
humanLoopConfig_taskDescription = 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 :: Lens' HumanLoopConfig Natural
humanLoopConfig_taskCount = 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 Data.FromJSON HumanLoopConfig where
  parseJSON :: Value -> Parser HumanLoopConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HumanLoopConfig"
      ( \Object
x ->
          Maybe PublicWorkforceTaskPrice
-> Maybe Natural
-> Maybe (NonEmpty Text)
-> Maybe Natural
-> Text
-> Text
-> Text
-> Text
-> Natural
-> HumanLoopConfig
HumanLoopConfig'
            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
"PublicWorkforceTaskPrice")
            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
"TaskAvailabilityLifetimeInSeconds")
            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
"TaskKeywords")
            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
"TaskTimeLimitInSeconds")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"WorkteamArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"HumanTaskUiArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TaskTitle")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TaskDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TaskCount")
      )

instance Prelude.Hashable HumanLoopConfig where
  hashWithSalt :: Int -> HumanLoopConfig -> Int
hashWithSalt Int
_salt HumanLoopConfig' {Natural
Maybe Natural
Maybe (NonEmpty Text)
Maybe PublicWorkforceTaskPrice
Text
taskCount :: Natural
taskDescription :: Text
taskTitle :: Text
humanTaskUiArn :: Text
workteamArn :: Text
taskTimeLimitInSeconds :: Maybe Natural
taskKeywords :: Maybe (NonEmpty Text)
taskAvailabilityLifetimeInSeconds :: Maybe Natural
publicWorkforceTaskPrice :: Maybe PublicWorkforceTaskPrice
$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:taskTimeLimitInSeconds:HumanLoopConfig' :: HumanLoopConfig -> Maybe Natural
$sel:taskKeywords:HumanLoopConfig' :: HumanLoopConfig -> Maybe (NonEmpty Text)
$sel:taskAvailabilityLifetimeInSeconds:HumanLoopConfig' :: HumanLoopConfig -> Maybe Natural
$sel:publicWorkforceTaskPrice:HumanLoopConfig' :: HumanLoopConfig -> Maybe PublicWorkforceTaskPrice
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PublicWorkforceTaskPrice
publicWorkforceTaskPrice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
taskAvailabilityLifetimeInSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
taskKeywords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
taskTimeLimitInSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workteamArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
humanTaskUiArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
taskTitle
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
taskDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
taskCount

instance Prelude.NFData HumanLoopConfig where
  rnf :: HumanLoopConfig -> ()
rnf HumanLoopConfig' {Natural
Maybe Natural
Maybe (NonEmpty Text)
Maybe PublicWorkforceTaskPrice
Text
taskCount :: Natural
taskDescription :: Text
taskTitle :: Text
humanTaskUiArn :: Text
workteamArn :: Text
taskTimeLimitInSeconds :: Maybe Natural
taskKeywords :: Maybe (NonEmpty Text)
taskAvailabilityLifetimeInSeconds :: Maybe Natural
publicWorkforceTaskPrice :: Maybe PublicWorkforceTaskPrice
$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:taskTimeLimitInSeconds:HumanLoopConfig' :: HumanLoopConfig -> Maybe Natural
$sel:taskKeywords:HumanLoopConfig' :: HumanLoopConfig -> Maybe (NonEmpty Text)
$sel:taskAvailabilityLifetimeInSeconds:HumanLoopConfig' :: HumanLoopConfig -> Maybe Natural
$sel:publicWorkforceTaskPrice:HumanLoopConfig' :: HumanLoopConfig -> Maybe PublicWorkforceTaskPrice
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe PublicWorkforceTaskPrice
publicWorkforceTaskPrice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
taskAvailabilityLifetimeInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
taskKeywords
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
taskTimeLimitInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
workteamArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
humanTaskUiArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
taskTitle
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
taskDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
taskCount

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