{-# 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.Glue.Types.TaskRunProperties
-- 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.Glue.Types.TaskRunProperties where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.ExportLabelsTaskRunProperties
import Amazonka.Glue.Types.FindMatchesTaskRunProperties
import Amazonka.Glue.Types.ImportLabelsTaskRunProperties
import Amazonka.Glue.Types.LabelingSetGenerationTaskRunProperties
import Amazonka.Glue.Types.TaskType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The configuration properties for the task run.
--
-- /See:/ 'newTaskRunProperties' smart constructor.
data TaskRunProperties = TaskRunProperties'
  { -- | The type of task run.
    TaskRunProperties -> Maybe TaskType
taskType :: Prelude.Maybe TaskType,
    -- | The configuration properties for an exporting labels task run.
    TaskRunProperties -> Maybe ExportLabelsTaskRunProperties
exportLabelsTaskRunProperties :: Prelude.Maybe ExportLabelsTaskRunProperties,
    -- | The configuration properties for a labeling set generation task run.
    TaskRunProperties -> Maybe LabelingSetGenerationTaskRunProperties
labelingSetGenerationTaskRunProperties :: Prelude.Maybe LabelingSetGenerationTaskRunProperties,
    -- | The configuration properties for a find matches task run.
    TaskRunProperties -> Maybe FindMatchesTaskRunProperties
findMatchesTaskRunProperties :: Prelude.Maybe FindMatchesTaskRunProperties,
    -- | The configuration properties for an importing labels task run.
    TaskRunProperties -> Maybe ImportLabelsTaskRunProperties
importLabelsTaskRunProperties :: Prelude.Maybe ImportLabelsTaskRunProperties
  }
  deriving (TaskRunProperties -> TaskRunProperties -> Bool
(TaskRunProperties -> TaskRunProperties -> Bool)
-> (TaskRunProperties -> TaskRunProperties -> Bool)
-> Eq TaskRunProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TaskRunProperties -> TaskRunProperties -> Bool
$c/= :: TaskRunProperties -> TaskRunProperties -> Bool
== :: TaskRunProperties -> TaskRunProperties -> Bool
$c== :: TaskRunProperties -> TaskRunProperties -> Bool
Prelude.Eq, ReadPrec [TaskRunProperties]
ReadPrec TaskRunProperties
Int -> ReadS TaskRunProperties
ReadS [TaskRunProperties]
(Int -> ReadS TaskRunProperties)
-> ReadS [TaskRunProperties]
-> ReadPrec TaskRunProperties
-> ReadPrec [TaskRunProperties]
-> Read TaskRunProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TaskRunProperties]
$creadListPrec :: ReadPrec [TaskRunProperties]
readPrec :: ReadPrec TaskRunProperties
$creadPrec :: ReadPrec TaskRunProperties
readList :: ReadS [TaskRunProperties]
$creadList :: ReadS [TaskRunProperties]
readsPrec :: Int -> ReadS TaskRunProperties
$creadsPrec :: Int -> ReadS TaskRunProperties
Prelude.Read, Int -> TaskRunProperties -> ShowS
[TaskRunProperties] -> ShowS
TaskRunProperties -> String
(Int -> TaskRunProperties -> ShowS)
-> (TaskRunProperties -> String)
-> ([TaskRunProperties] -> ShowS)
-> Show TaskRunProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TaskRunProperties] -> ShowS
$cshowList :: [TaskRunProperties] -> ShowS
show :: TaskRunProperties -> String
$cshow :: TaskRunProperties -> String
showsPrec :: Int -> TaskRunProperties -> ShowS
$cshowsPrec :: Int -> TaskRunProperties -> ShowS
Prelude.Show, (forall x. TaskRunProperties -> Rep TaskRunProperties x)
-> (forall x. Rep TaskRunProperties x -> TaskRunProperties)
-> Generic TaskRunProperties
forall x. Rep TaskRunProperties x -> TaskRunProperties
forall x. TaskRunProperties -> Rep TaskRunProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TaskRunProperties x -> TaskRunProperties
$cfrom :: forall x. TaskRunProperties -> Rep TaskRunProperties x
Prelude.Generic)

-- |
-- Create a value of 'TaskRunProperties' 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:
--
-- 'taskType', 'taskRunProperties_taskType' - The type of task run.
--
-- 'exportLabelsTaskRunProperties', 'taskRunProperties_exportLabelsTaskRunProperties' - The configuration properties for an exporting labels task run.
--
-- 'labelingSetGenerationTaskRunProperties', 'taskRunProperties_labelingSetGenerationTaskRunProperties' - The configuration properties for a labeling set generation task run.
--
-- 'findMatchesTaskRunProperties', 'taskRunProperties_findMatchesTaskRunProperties' - The configuration properties for a find matches task run.
--
-- 'importLabelsTaskRunProperties', 'taskRunProperties_importLabelsTaskRunProperties' - The configuration properties for an importing labels task run.
newTaskRunProperties ::
  TaskRunProperties
newTaskRunProperties :: TaskRunProperties
newTaskRunProperties =
  TaskRunProperties' :: Maybe TaskType
-> Maybe ExportLabelsTaskRunProperties
-> Maybe LabelingSetGenerationTaskRunProperties
-> Maybe FindMatchesTaskRunProperties
-> Maybe ImportLabelsTaskRunProperties
-> TaskRunProperties
TaskRunProperties'
    { $sel:taskType:TaskRunProperties' :: Maybe TaskType
taskType = Maybe TaskType
forall a. Maybe a
Prelude.Nothing,
      $sel:exportLabelsTaskRunProperties:TaskRunProperties' :: Maybe ExportLabelsTaskRunProperties
exportLabelsTaskRunProperties = Maybe ExportLabelsTaskRunProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:labelingSetGenerationTaskRunProperties:TaskRunProperties' :: Maybe LabelingSetGenerationTaskRunProperties
labelingSetGenerationTaskRunProperties =
        Maybe LabelingSetGenerationTaskRunProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:findMatchesTaskRunProperties:TaskRunProperties' :: Maybe FindMatchesTaskRunProperties
findMatchesTaskRunProperties = Maybe FindMatchesTaskRunProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:importLabelsTaskRunProperties:TaskRunProperties' :: Maybe ImportLabelsTaskRunProperties
importLabelsTaskRunProperties = Maybe ImportLabelsTaskRunProperties
forall a. Maybe a
Prelude.Nothing
    }

-- | The type of task run.
taskRunProperties_taskType :: Lens.Lens' TaskRunProperties (Prelude.Maybe TaskType)
taskRunProperties_taskType :: (Maybe TaskType -> f (Maybe TaskType))
-> TaskRunProperties -> f TaskRunProperties
taskRunProperties_taskType = (TaskRunProperties -> Maybe TaskType)
-> (TaskRunProperties -> Maybe TaskType -> TaskRunProperties)
-> Lens
     TaskRunProperties
     TaskRunProperties
     (Maybe TaskType)
     (Maybe TaskType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskRunProperties' {Maybe TaskType
taskType :: Maybe TaskType
$sel:taskType:TaskRunProperties' :: TaskRunProperties -> Maybe TaskType
taskType} -> Maybe TaskType
taskType) (\s :: TaskRunProperties
s@TaskRunProperties' {} Maybe TaskType
a -> TaskRunProperties
s {$sel:taskType:TaskRunProperties' :: Maybe TaskType
taskType = Maybe TaskType
a} :: TaskRunProperties)

-- | The configuration properties for an exporting labels task run.
taskRunProperties_exportLabelsTaskRunProperties :: Lens.Lens' TaskRunProperties (Prelude.Maybe ExportLabelsTaskRunProperties)
taskRunProperties_exportLabelsTaskRunProperties :: (Maybe ExportLabelsTaskRunProperties
 -> f (Maybe ExportLabelsTaskRunProperties))
-> TaskRunProperties -> f TaskRunProperties
taskRunProperties_exportLabelsTaskRunProperties = (TaskRunProperties -> Maybe ExportLabelsTaskRunProperties)
-> (TaskRunProperties
    -> Maybe ExportLabelsTaskRunProperties -> TaskRunProperties)
-> Lens
     TaskRunProperties
     TaskRunProperties
     (Maybe ExportLabelsTaskRunProperties)
     (Maybe ExportLabelsTaskRunProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskRunProperties' {Maybe ExportLabelsTaskRunProperties
exportLabelsTaskRunProperties :: Maybe ExportLabelsTaskRunProperties
$sel:exportLabelsTaskRunProperties:TaskRunProperties' :: TaskRunProperties -> Maybe ExportLabelsTaskRunProperties
exportLabelsTaskRunProperties} -> Maybe ExportLabelsTaskRunProperties
exportLabelsTaskRunProperties) (\s :: TaskRunProperties
s@TaskRunProperties' {} Maybe ExportLabelsTaskRunProperties
a -> TaskRunProperties
s {$sel:exportLabelsTaskRunProperties:TaskRunProperties' :: Maybe ExportLabelsTaskRunProperties
exportLabelsTaskRunProperties = Maybe ExportLabelsTaskRunProperties
a} :: TaskRunProperties)

-- | The configuration properties for a labeling set generation task run.
taskRunProperties_labelingSetGenerationTaskRunProperties :: Lens.Lens' TaskRunProperties (Prelude.Maybe LabelingSetGenerationTaskRunProperties)
taskRunProperties_labelingSetGenerationTaskRunProperties :: (Maybe LabelingSetGenerationTaskRunProperties
 -> f (Maybe LabelingSetGenerationTaskRunProperties))
-> TaskRunProperties -> f TaskRunProperties
taskRunProperties_labelingSetGenerationTaskRunProperties = (TaskRunProperties -> Maybe LabelingSetGenerationTaskRunProperties)
-> (TaskRunProperties
    -> Maybe LabelingSetGenerationTaskRunProperties
    -> TaskRunProperties)
-> Lens
     TaskRunProperties
     TaskRunProperties
     (Maybe LabelingSetGenerationTaskRunProperties)
     (Maybe LabelingSetGenerationTaskRunProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskRunProperties' {Maybe LabelingSetGenerationTaskRunProperties
labelingSetGenerationTaskRunProperties :: Maybe LabelingSetGenerationTaskRunProperties
$sel:labelingSetGenerationTaskRunProperties:TaskRunProperties' :: TaskRunProperties -> Maybe LabelingSetGenerationTaskRunProperties
labelingSetGenerationTaskRunProperties} -> Maybe LabelingSetGenerationTaskRunProperties
labelingSetGenerationTaskRunProperties) (\s :: TaskRunProperties
s@TaskRunProperties' {} Maybe LabelingSetGenerationTaskRunProperties
a -> TaskRunProperties
s {$sel:labelingSetGenerationTaskRunProperties:TaskRunProperties' :: Maybe LabelingSetGenerationTaskRunProperties
labelingSetGenerationTaskRunProperties = Maybe LabelingSetGenerationTaskRunProperties
a} :: TaskRunProperties)

-- | The configuration properties for a find matches task run.
taskRunProperties_findMatchesTaskRunProperties :: Lens.Lens' TaskRunProperties (Prelude.Maybe FindMatchesTaskRunProperties)
taskRunProperties_findMatchesTaskRunProperties :: (Maybe FindMatchesTaskRunProperties
 -> f (Maybe FindMatchesTaskRunProperties))
-> TaskRunProperties -> f TaskRunProperties
taskRunProperties_findMatchesTaskRunProperties = (TaskRunProperties -> Maybe FindMatchesTaskRunProperties)
-> (TaskRunProperties
    -> Maybe FindMatchesTaskRunProperties -> TaskRunProperties)
-> Lens
     TaskRunProperties
     TaskRunProperties
     (Maybe FindMatchesTaskRunProperties)
     (Maybe FindMatchesTaskRunProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskRunProperties' {Maybe FindMatchesTaskRunProperties
findMatchesTaskRunProperties :: Maybe FindMatchesTaskRunProperties
$sel:findMatchesTaskRunProperties:TaskRunProperties' :: TaskRunProperties -> Maybe FindMatchesTaskRunProperties
findMatchesTaskRunProperties} -> Maybe FindMatchesTaskRunProperties
findMatchesTaskRunProperties) (\s :: TaskRunProperties
s@TaskRunProperties' {} Maybe FindMatchesTaskRunProperties
a -> TaskRunProperties
s {$sel:findMatchesTaskRunProperties:TaskRunProperties' :: Maybe FindMatchesTaskRunProperties
findMatchesTaskRunProperties = Maybe FindMatchesTaskRunProperties
a} :: TaskRunProperties)

-- | The configuration properties for an importing labels task run.
taskRunProperties_importLabelsTaskRunProperties :: Lens.Lens' TaskRunProperties (Prelude.Maybe ImportLabelsTaskRunProperties)
taskRunProperties_importLabelsTaskRunProperties :: (Maybe ImportLabelsTaskRunProperties
 -> f (Maybe ImportLabelsTaskRunProperties))
-> TaskRunProperties -> f TaskRunProperties
taskRunProperties_importLabelsTaskRunProperties = (TaskRunProperties -> Maybe ImportLabelsTaskRunProperties)
-> (TaskRunProperties
    -> Maybe ImportLabelsTaskRunProperties -> TaskRunProperties)
-> Lens
     TaskRunProperties
     TaskRunProperties
     (Maybe ImportLabelsTaskRunProperties)
     (Maybe ImportLabelsTaskRunProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskRunProperties' {Maybe ImportLabelsTaskRunProperties
importLabelsTaskRunProperties :: Maybe ImportLabelsTaskRunProperties
$sel:importLabelsTaskRunProperties:TaskRunProperties' :: TaskRunProperties -> Maybe ImportLabelsTaskRunProperties
importLabelsTaskRunProperties} -> Maybe ImportLabelsTaskRunProperties
importLabelsTaskRunProperties) (\s :: TaskRunProperties
s@TaskRunProperties' {} Maybe ImportLabelsTaskRunProperties
a -> TaskRunProperties
s {$sel:importLabelsTaskRunProperties:TaskRunProperties' :: Maybe ImportLabelsTaskRunProperties
importLabelsTaskRunProperties = Maybe ImportLabelsTaskRunProperties
a} :: TaskRunProperties)

instance Core.FromJSON TaskRunProperties where
  parseJSON :: Value -> Parser TaskRunProperties
parseJSON =
    String
-> (Object -> Parser TaskRunProperties)
-> Value
-> Parser TaskRunProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TaskRunProperties"
      ( \Object
x ->
          Maybe TaskType
-> Maybe ExportLabelsTaskRunProperties
-> Maybe LabelingSetGenerationTaskRunProperties
-> Maybe FindMatchesTaskRunProperties
-> Maybe ImportLabelsTaskRunProperties
-> TaskRunProperties
TaskRunProperties'
            (Maybe TaskType
 -> Maybe ExportLabelsTaskRunProperties
 -> Maybe LabelingSetGenerationTaskRunProperties
 -> Maybe FindMatchesTaskRunProperties
 -> Maybe ImportLabelsTaskRunProperties
 -> TaskRunProperties)
-> Parser (Maybe TaskType)
-> Parser
     (Maybe ExportLabelsTaskRunProperties
      -> Maybe LabelingSetGenerationTaskRunProperties
      -> Maybe FindMatchesTaskRunProperties
      -> Maybe ImportLabelsTaskRunProperties
      -> TaskRunProperties)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TaskType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TaskType")
            Parser
  (Maybe ExportLabelsTaskRunProperties
   -> Maybe LabelingSetGenerationTaskRunProperties
   -> Maybe FindMatchesTaskRunProperties
   -> Maybe ImportLabelsTaskRunProperties
   -> TaskRunProperties)
-> Parser (Maybe ExportLabelsTaskRunProperties)
-> Parser
     (Maybe LabelingSetGenerationTaskRunProperties
      -> Maybe FindMatchesTaskRunProperties
      -> Maybe ImportLabelsTaskRunProperties
      -> TaskRunProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExportLabelsTaskRunProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExportLabelsTaskRunProperties")
            Parser
  (Maybe LabelingSetGenerationTaskRunProperties
   -> Maybe FindMatchesTaskRunProperties
   -> Maybe ImportLabelsTaskRunProperties
   -> TaskRunProperties)
-> Parser (Maybe LabelingSetGenerationTaskRunProperties)
-> Parser
     (Maybe FindMatchesTaskRunProperties
      -> Maybe ImportLabelsTaskRunProperties -> TaskRunProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe LabelingSetGenerationTaskRunProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LabelingSetGenerationTaskRunProperties")
            Parser
  (Maybe FindMatchesTaskRunProperties
   -> Maybe ImportLabelsTaskRunProperties -> TaskRunProperties)
-> Parser (Maybe FindMatchesTaskRunProperties)
-> Parser
     (Maybe ImportLabelsTaskRunProperties -> TaskRunProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FindMatchesTaskRunProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FindMatchesTaskRunProperties")
            Parser (Maybe ImportLabelsTaskRunProperties -> TaskRunProperties)
-> Parser (Maybe ImportLabelsTaskRunProperties)
-> Parser TaskRunProperties
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ImportLabelsTaskRunProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImportLabelsTaskRunProperties")
      )

instance Prelude.Hashable TaskRunProperties

instance Prelude.NFData TaskRunProperties