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

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

-- | 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 :: Lens' LabelCounters (Maybe Natural)
labelCounters_failedNonRetryableError = 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 labeled by a human worker.
labelCounters_humanLabeled :: Lens.Lens' LabelCounters (Prelude.Maybe Prelude.Natural)
labelCounters_humanLabeled :: Lens' LabelCounters (Maybe Natural)
labelCounters_humanLabeled = 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)

-- | The total number of objects labeled by automated data labeling.
labelCounters_machineLabeled :: Lens.Lens' LabelCounters (Prelude.Maybe Prelude.Natural)
labelCounters_machineLabeled :: Lens' LabelCounters (Maybe Natural)
labelCounters_machineLabeled = 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 :: Lens' LabelCounters (Maybe Natural)
labelCounters_totalLabeled = 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 not yet labeled.
labelCounters_unlabeled :: Lens.Lens' LabelCounters (Prelude.Maybe Prelude.Natural)
labelCounters_unlabeled :: Lens' LabelCounters (Maybe Natural)
labelCounters_unlabeled = 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)

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

instance Prelude.Hashable LabelCounters where
  hashWithSalt :: Int -> LabelCounters -> Int
hashWithSalt Int
_salt LabelCounters' {Maybe Natural
unlabeled :: Maybe Natural
totalLabeled :: Maybe Natural
machineLabeled :: Maybe Natural
humanLabeled :: Maybe Natural
failedNonRetryableError :: Maybe Natural
$sel:unlabeled:LabelCounters' :: LabelCounters -> Maybe Natural
$sel:totalLabeled:LabelCounters' :: LabelCounters -> Maybe Natural
$sel:machineLabeled:LabelCounters' :: LabelCounters -> Maybe Natural
$sel:humanLabeled:LabelCounters' :: LabelCounters -> Maybe Natural
$sel:failedNonRetryableError:LabelCounters' :: LabelCounters -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
failedNonRetryableError
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
humanLabeled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
machineLabeled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
totalLabeled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
unlabeled

instance Prelude.NFData LabelCounters where
  rnf :: LabelCounters -> ()
rnf LabelCounters' {Maybe Natural
unlabeled :: Maybe Natural
totalLabeled :: Maybe Natural
machineLabeled :: Maybe Natural
humanLabeled :: Maybe Natural
failedNonRetryableError :: Maybe Natural
$sel:unlabeled:LabelCounters' :: LabelCounters -> Maybe Natural
$sel:totalLabeled:LabelCounters' :: LabelCounters -> Maybe Natural
$sel:machineLabeled:LabelCounters' :: LabelCounters -> Maybe Natural
$sel:humanLabeled:LabelCounters' :: LabelCounters -> Maybe Natural
$sel:failedNonRetryableError:LabelCounters' :: LabelCounters -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
failedNonRetryableError
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
humanLabeled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
machineLabeled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
totalLabeled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
unlabeled