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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides a breakdown of the number of objects labeled.
--
-- /See:/ 'newLabelCounters' smart constructor.
data LabelCounters = LabelCounters'
  { -- | The total number of objects labeled by automated data labeling.
    LabelCounters -> Maybe Natural
machineLabeled :: Prelude.Maybe Prelude.Natural,
    -- | The total number of objects labeled.
    LabelCounters -> Maybe Natural
totalLabeled :: Prelude.Maybe Prelude.Natural,
    -- | The total number of objects that could not be labeled due to an error.
    LabelCounters -> Maybe Natural
failedNonRetryableError :: Prelude.Maybe Prelude.Natural,
    -- | The total number of objects not yet labeled.
    LabelCounters -> Maybe Natural
unlabeled :: Prelude.Maybe Prelude.Natural,
    -- | The total number of objects labeled by a human worker.
    LabelCounters -> Maybe Natural
humanLabeled :: Prelude.Maybe Prelude.Natural
  }
  deriving (LabelCounters -> LabelCounters -> Bool
(LabelCounters -> LabelCounters -> Bool)
-> (LabelCounters -> LabelCounters -> Bool) -> Eq LabelCounters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LabelCounters -> LabelCounters -> Bool
$c/= :: LabelCounters -> LabelCounters -> Bool
== :: LabelCounters -> LabelCounters -> Bool
$c== :: LabelCounters -> LabelCounters -> Bool
Prelude.Eq, ReadPrec [LabelCounters]
ReadPrec LabelCounters
Int -> ReadS LabelCounters
ReadS [LabelCounters]
(Int -> ReadS LabelCounters)
-> ReadS [LabelCounters]
-> ReadPrec LabelCounters
-> ReadPrec [LabelCounters]
-> Read LabelCounters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LabelCounters]
$creadListPrec :: ReadPrec [LabelCounters]
readPrec :: ReadPrec LabelCounters
$creadPrec :: ReadPrec LabelCounters
readList :: ReadS [LabelCounters]
$creadList :: ReadS [LabelCounters]
readsPrec :: Int -> ReadS LabelCounters
$creadsPrec :: Int -> ReadS LabelCounters
Prelude.Read, Int -> LabelCounters -> ShowS
[LabelCounters] -> ShowS
LabelCounters -> String
(Int -> LabelCounters -> ShowS)
-> (LabelCounters -> String)
-> ([LabelCounters] -> ShowS)
-> Show LabelCounters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabelCounters] -> ShowS
$cshowList :: [LabelCounters] -> ShowS
show :: LabelCounters -> String
$cshow :: LabelCounters -> String
showsPrec :: Int -> LabelCounters -> ShowS
$cshowsPrec :: Int -> LabelCounters -> ShowS
Prelude.Show, (forall x. LabelCounters -> Rep LabelCounters x)
-> (forall x. Rep LabelCounters x -> LabelCounters)
-> Generic LabelCounters
forall x. Rep LabelCounters x -> LabelCounters
forall x. LabelCounters -> Rep LabelCounters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LabelCounters x -> LabelCounters
$cfrom :: forall x. LabelCounters -> Rep LabelCounters x
Prelude.Generic)

-- |
-- Create a value of 'LabelCounters' 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:
--
-- 'machineLabeled', 'labelCounters_machineLabeled' - The total number of objects labeled by automated data labeling.
--
-- 'totalLabeled', 'labelCounters_totalLabeled' - The total number of objects labeled.
--
-- 'failedNonRetryableError', 'labelCounters_failedNonRetryableError' - The total number of objects that could not be labeled due to an error.
--
-- 'unlabeled', 'labelCounters_unlabeled' - The total number of objects not yet labeled.
--
-- 'humanLabeled', 'labelCounters_humanLabeled' - The total number of objects labeled by a human worker.
newLabelCounters ::
  LabelCounters
newLabelCounters :: LabelCounters
newLabelCounters =
  LabelCounters' :: Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> LabelCounters
LabelCounters'
    { $sel:machineLabeled:LabelCounters' :: Maybe Natural
machineLabeled = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:totalLabeled:LabelCounters' :: Maybe Natural
totalLabeled = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:failedNonRetryableError:LabelCounters' :: Maybe Natural
failedNonRetryableError = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:unlabeled:LabelCounters' :: Maybe Natural
unlabeled = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:humanLabeled:LabelCounters' :: Maybe Natural
humanLabeled = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The total number of objects labeled by automated data labeling.
labelCounters_machineLabeled :: Lens.Lens' LabelCounters (Prelude.Maybe Prelude.Natural)
labelCounters_machineLabeled :: (Maybe Natural -> f (Maybe Natural))
-> LabelCounters -> f LabelCounters
labelCounters_machineLabeled = (LabelCounters -> Maybe Natural)
-> (LabelCounters -> Maybe Natural -> LabelCounters)
-> Lens LabelCounters LabelCounters (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelCounters' {Maybe Natural
machineLabeled :: Maybe Natural
$sel:machineLabeled:LabelCounters' :: LabelCounters -> Maybe Natural
machineLabeled} -> Maybe Natural
machineLabeled) (\s :: LabelCounters
s@LabelCounters' {} Maybe Natural
a -> LabelCounters
s {$sel:machineLabeled:LabelCounters' :: Maybe Natural
machineLabeled = Maybe Natural
a} :: LabelCounters)

-- | The total number of objects labeled.
labelCounters_totalLabeled :: Lens.Lens' LabelCounters (Prelude.Maybe Prelude.Natural)
labelCounters_totalLabeled :: (Maybe Natural -> f (Maybe Natural))
-> LabelCounters -> f LabelCounters
labelCounters_totalLabeled = (LabelCounters -> Maybe Natural)
-> (LabelCounters -> Maybe Natural -> LabelCounters)
-> Lens LabelCounters LabelCounters (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelCounters' {Maybe Natural
totalLabeled :: Maybe Natural
$sel:totalLabeled:LabelCounters' :: LabelCounters -> Maybe Natural
totalLabeled} -> Maybe Natural
totalLabeled) (\s :: LabelCounters
s@LabelCounters' {} Maybe Natural
a -> LabelCounters
s {$sel:totalLabeled:LabelCounters' :: Maybe Natural
totalLabeled = Maybe Natural
a} :: LabelCounters)

-- | The total number of objects that could not be labeled due to an error.
labelCounters_failedNonRetryableError :: Lens.Lens' LabelCounters (Prelude.Maybe Prelude.Natural)
labelCounters_failedNonRetryableError :: (Maybe Natural -> f (Maybe Natural))
-> LabelCounters -> f LabelCounters
labelCounters_failedNonRetryableError = (LabelCounters -> Maybe Natural)
-> (LabelCounters -> Maybe Natural -> LabelCounters)
-> Lens LabelCounters LabelCounters (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelCounters' {Maybe Natural
failedNonRetryableError :: Maybe Natural
$sel:failedNonRetryableError:LabelCounters' :: LabelCounters -> Maybe Natural
failedNonRetryableError} -> Maybe Natural
failedNonRetryableError) (\s :: LabelCounters
s@LabelCounters' {} Maybe Natural
a -> LabelCounters
s {$sel:failedNonRetryableError:LabelCounters' :: Maybe Natural
failedNonRetryableError = Maybe Natural
a} :: LabelCounters)

-- | The total number of objects not yet labeled.
labelCounters_unlabeled :: Lens.Lens' LabelCounters (Prelude.Maybe Prelude.Natural)
labelCounters_unlabeled :: (Maybe Natural -> f (Maybe Natural))
-> LabelCounters -> f LabelCounters
labelCounters_unlabeled = (LabelCounters -> Maybe Natural)
-> (LabelCounters -> Maybe Natural -> LabelCounters)
-> Lens LabelCounters LabelCounters (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelCounters' {Maybe Natural
unlabeled :: Maybe Natural
$sel:unlabeled:LabelCounters' :: LabelCounters -> Maybe Natural
unlabeled} -> Maybe Natural
unlabeled) (\s :: LabelCounters
s@LabelCounters' {} Maybe Natural
a -> LabelCounters
s {$sel:unlabeled:LabelCounters' :: Maybe Natural
unlabeled = Maybe Natural
a} :: LabelCounters)

-- | The total number of objects labeled by a human worker.
labelCounters_humanLabeled :: Lens.Lens' LabelCounters (Prelude.Maybe Prelude.Natural)
labelCounters_humanLabeled :: (Maybe Natural -> f (Maybe Natural))
-> LabelCounters -> f LabelCounters
labelCounters_humanLabeled = (LabelCounters -> Maybe Natural)
-> (LabelCounters -> Maybe Natural -> LabelCounters)
-> Lens LabelCounters LabelCounters (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelCounters' {Maybe Natural
humanLabeled :: Maybe Natural
$sel:humanLabeled:LabelCounters' :: LabelCounters -> Maybe Natural
humanLabeled} -> Maybe Natural
humanLabeled) (\s :: LabelCounters
s@LabelCounters' {} Maybe Natural
a -> LabelCounters
s {$sel:humanLabeled:LabelCounters' :: Maybe Natural
humanLabeled = Maybe Natural
a} :: LabelCounters)

instance Core.FromJSON LabelCounters where
  parseJSON :: Value -> Parser LabelCounters
parseJSON =
    String
-> (Object -> Parser LabelCounters)
-> Value
-> Parser LabelCounters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LabelCounters"
      ( \Object
x ->
          Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> LabelCounters
LabelCounters'
            (Maybe Natural
 -> Maybe Natural
 -> Maybe Natural
 -> Maybe Natural
 -> Maybe Natural
 -> LabelCounters)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Natural
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Natural
      -> LabelCounters)
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
"MachineLabeled")
            Parser
  (Maybe Natural
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Natural
   -> LabelCounters)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Natural -> Maybe Natural -> Maybe Natural -> LabelCounters)
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
"TotalLabeled")
            Parser
  (Maybe Natural -> Maybe Natural -> Maybe Natural -> LabelCounters)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> Maybe Natural -> LabelCounters)
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
"FailedNonRetryableError")
            Parser (Maybe Natural -> Maybe Natural -> LabelCounters)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> LabelCounters)
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
"Unlabeled")
            Parser (Maybe Natural -> LabelCounters)
-> Parser (Maybe Natural) -> Parser LabelCounters
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
"HumanLabeled")
      )

instance Prelude.Hashable LabelCounters

instance Prelude.NFData LabelCounters