{-# 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 #-}
module Amazonka.SageMaker.Types.LabelingJobStoppingConditions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LabelingJobStoppingConditions = LabelingJobStoppingConditions'
{
LabelingJobStoppingConditions -> Maybe Natural
maxHumanLabeledObjectCount :: Prelude.Maybe Prelude.Natural,
LabelingJobStoppingConditions -> Maybe Natural
maxPercentageOfInputDatasetLabeled :: Prelude.Maybe Prelude.Natural
}
deriving (LabelingJobStoppingConditions
-> LabelingJobStoppingConditions -> Bool
(LabelingJobStoppingConditions
-> LabelingJobStoppingConditions -> Bool)
-> (LabelingJobStoppingConditions
-> LabelingJobStoppingConditions -> Bool)
-> Eq LabelingJobStoppingConditions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LabelingJobStoppingConditions
-> LabelingJobStoppingConditions -> Bool
$c/= :: LabelingJobStoppingConditions
-> LabelingJobStoppingConditions -> Bool
== :: LabelingJobStoppingConditions
-> LabelingJobStoppingConditions -> Bool
$c== :: LabelingJobStoppingConditions
-> LabelingJobStoppingConditions -> Bool
Prelude.Eq, ReadPrec [LabelingJobStoppingConditions]
ReadPrec LabelingJobStoppingConditions
Int -> ReadS LabelingJobStoppingConditions
ReadS [LabelingJobStoppingConditions]
(Int -> ReadS LabelingJobStoppingConditions)
-> ReadS [LabelingJobStoppingConditions]
-> ReadPrec LabelingJobStoppingConditions
-> ReadPrec [LabelingJobStoppingConditions]
-> Read LabelingJobStoppingConditions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LabelingJobStoppingConditions]
$creadListPrec :: ReadPrec [LabelingJobStoppingConditions]
readPrec :: ReadPrec LabelingJobStoppingConditions
$creadPrec :: ReadPrec LabelingJobStoppingConditions
readList :: ReadS [LabelingJobStoppingConditions]
$creadList :: ReadS [LabelingJobStoppingConditions]
readsPrec :: Int -> ReadS LabelingJobStoppingConditions
$creadsPrec :: Int -> ReadS LabelingJobStoppingConditions
Prelude.Read, Int -> LabelingJobStoppingConditions -> ShowS
[LabelingJobStoppingConditions] -> ShowS
LabelingJobStoppingConditions -> String
(Int -> LabelingJobStoppingConditions -> ShowS)
-> (LabelingJobStoppingConditions -> String)
-> ([LabelingJobStoppingConditions] -> ShowS)
-> Show LabelingJobStoppingConditions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabelingJobStoppingConditions] -> ShowS
$cshowList :: [LabelingJobStoppingConditions] -> ShowS
show :: LabelingJobStoppingConditions -> String
$cshow :: LabelingJobStoppingConditions -> String
showsPrec :: Int -> LabelingJobStoppingConditions -> ShowS
$cshowsPrec :: Int -> LabelingJobStoppingConditions -> ShowS
Prelude.Show, (forall x.
LabelingJobStoppingConditions
-> Rep LabelingJobStoppingConditions x)
-> (forall x.
Rep LabelingJobStoppingConditions x
-> LabelingJobStoppingConditions)
-> Generic LabelingJobStoppingConditions
forall x.
Rep LabelingJobStoppingConditions x
-> LabelingJobStoppingConditions
forall x.
LabelingJobStoppingConditions
-> Rep LabelingJobStoppingConditions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LabelingJobStoppingConditions x
-> LabelingJobStoppingConditions
$cfrom :: forall x.
LabelingJobStoppingConditions
-> Rep LabelingJobStoppingConditions x
Prelude.Generic)
newLabelingJobStoppingConditions ::
LabelingJobStoppingConditions
newLabelingJobStoppingConditions :: LabelingJobStoppingConditions
newLabelingJobStoppingConditions =
LabelingJobStoppingConditions' :: Maybe Natural -> Maybe Natural -> LabelingJobStoppingConditions
LabelingJobStoppingConditions'
{ $sel:maxHumanLabeledObjectCount:LabelingJobStoppingConditions' :: Maybe Natural
maxHumanLabeledObjectCount =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maxPercentageOfInputDatasetLabeled:LabelingJobStoppingConditions' :: Maybe Natural
maxPercentageOfInputDatasetLabeled =
Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
labelingJobStoppingConditions_maxHumanLabeledObjectCount :: Lens.Lens' LabelingJobStoppingConditions (Prelude.Maybe Prelude.Natural)
labelingJobStoppingConditions_maxHumanLabeledObjectCount :: (Maybe Natural -> f (Maybe Natural))
-> LabelingJobStoppingConditions -> f LabelingJobStoppingConditions
labelingJobStoppingConditions_maxHumanLabeledObjectCount = (LabelingJobStoppingConditions -> Maybe Natural)
-> (LabelingJobStoppingConditions
-> Maybe Natural -> LabelingJobStoppingConditions)
-> Lens
LabelingJobStoppingConditions
LabelingJobStoppingConditions
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelingJobStoppingConditions' {Maybe Natural
maxHumanLabeledObjectCount :: Maybe Natural
$sel:maxHumanLabeledObjectCount:LabelingJobStoppingConditions' :: LabelingJobStoppingConditions -> Maybe Natural
maxHumanLabeledObjectCount} -> Maybe Natural
maxHumanLabeledObjectCount) (\s :: LabelingJobStoppingConditions
s@LabelingJobStoppingConditions' {} Maybe Natural
a -> LabelingJobStoppingConditions
s {$sel:maxHumanLabeledObjectCount:LabelingJobStoppingConditions' :: Maybe Natural
maxHumanLabeledObjectCount = Maybe Natural
a} :: LabelingJobStoppingConditions)
labelingJobStoppingConditions_maxPercentageOfInputDatasetLabeled :: Lens.Lens' LabelingJobStoppingConditions (Prelude.Maybe Prelude.Natural)
labelingJobStoppingConditions_maxPercentageOfInputDatasetLabeled :: (Maybe Natural -> f (Maybe Natural))
-> LabelingJobStoppingConditions -> f LabelingJobStoppingConditions
labelingJobStoppingConditions_maxPercentageOfInputDatasetLabeled = (LabelingJobStoppingConditions -> Maybe Natural)
-> (LabelingJobStoppingConditions
-> Maybe Natural -> LabelingJobStoppingConditions)
-> Lens
LabelingJobStoppingConditions
LabelingJobStoppingConditions
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelingJobStoppingConditions' {Maybe Natural
maxPercentageOfInputDatasetLabeled :: Maybe Natural
$sel:maxPercentageOfInputDatasetLabeled:LabelingJobStoppingConditions' :: LabelingJobStoppingConditions -> Maybe Natural
maxPercentageOfInputDatasetLabeled} -> Maybe Natural
maxPercentageOfInputDatasetLabeled) (\s :: LabelingJobStoppingConditions
s@LabelingJobStoppingConditions' {} Maybe Natural
a -> LabelingJobStoppingConditions
s {$sel:maxPercentageOfInputDatasetLabeled:LabelingJobStoppingConditions' :: Maybe Natural
maxPercentageOfInputDatasetLabeled = Maybe Natural
a} :: LabelingJobStoppingConditions)
instance Core.FromJSON LabelingJobStoppingConditions where
parseJSON :: Value -> Parser LabelingJobStoppingConditions
parseJSON =
String
-> (Object -> Parser LabelingJobStoppingConditions)
-> Value
-> Parser LabelingJobStoppingConditions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LabelingJobStoppingConditions"
( \Object
x ->
Maybe Natural -> Maybe Natural -> LabelingJobStoppingConditions
LabelingJobStoppingConditions'
(Maybe Natural -> Maybe Natural -> LabelingJobStoppingConditions)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> LabelingJobStoppingConditions)
forall (f :: * -> *) a b. Functor 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
"MaxHumanLabeledObjectCount")
Parser (Maybe Natural -> LabelingJobStoppingConditions)
-> Parser (Maybe Natural) -> Parser LabelingJobStoppingConditions
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
"MaxPercentageOfInputDatasetLabeled")
)
instance
Prelude.Hashable
LabelingJobStoppingConditions
instance Prelude.NFData LabelingJobStoppingConditions
instance Core.ToJSON LabelingJobStoppingConditions where
toJSON :: LabelingJobStoppingConditions -> Value
toJSON LabelingJobStoppingConditions' {Maybe Natural
maxPercentageOfInputDatasetLabeled :: Maybe Natural
maxHumanLabeledObjectCount :: Maybe Natural
$sel:maxPercentageOfInputDatasetLabeled:LabelingJobStoppingConditions' :: LabelingJobStoppingConditions -> Maybe Natural
$sel:maxHumanLabeledObjectCount:LabelingJobStoppingConditions' :: LabelingJobStoppingConditions -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MaxHumanLabeledObjectCount" 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
maxHumanLabeledObjectCount,
(Text
"MaxPercentageOfInputDatasetLabeled" 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
maxPercentageOfInputDatasetLabeled
]
)