{-# 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.LookoutVision.Types.DatasetImageStats
-- 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.LookoutVision.Types.DatasetImageStats where

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

-- | Statistics about the images in a dataset.
--
-- /See:/ 'newDatasetImageStats' smart constructor.
data DatasetImageStats = DatasetImageStats'
  { -- | The total number of images labeled as normal.
    DatasetImageStats -> Maybe Int
normal :: Prelude.Maybe Prelude.Int,
    -- | the total number of images labeled as an anomaly.
    DatasetImageStats -> Maybe Int
anomaly :: Prelude.Maybe Prelude.Int,
    -- | The total number of labeled images.
    DatasetImageStats -> Maybe Int
labeled :: Prelude.Maybe Prelude.Int,
    -- | The total number of images in the dataset.
    DatasetImageStats -> Maybe Int
total :: Prelude.Maybe Prelude.Int
  }
  deriving (DatasetImageStats -> DatasetImageStats -> Bool
(DatasetImageStats -> DatasetImageStats -> Bool)
-> (DatasetImageStats -> DatasetImageStats -> Bool)
-> Eq DatasetImageStats
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatasetImageStats -> DatasetImageStats -> Bool
$c/= :: DatasetImageStats -> DatasetImageStats -> Bool
== :: DatasetImageStats -> DatasetImageStats -> Bool
$c== :: DatasetImageStats -> DatasetImageStats -> Bool
Prelude.Eq, ReadPrec [DatasetImageStats]
ReadPrec DatasetImageStats
Int -> ReadS DatasetImageStats
ReadS [DatasetImageStats]
(Int -> ReadS DatasetImageStats)
-> ReadS [DatasetImageStats]
-> ReadPrec DatasetImageStats
-> ReadPrec [DatasetImageStats]
-> Read DatasetImageStats
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatasetImageStats]
$creadListPrec :: ReadPrec [DatasetImageStats]
readPrec :: ReadPrec DatasetImageStats
$creadPrec :: ReadPrec DatasetImageStats
readList :: ReadS [DatasetImageStats]
$creadList :: ReadS [DatasetImageStats]
readsPrec :: Int -> ReadS DatasetImageStats
$creadsPrec :: Int -> ReadS DatasetImageStats
Prelude.Read, Int -> DatasetImageStats -> ShowS
[DatasetImageStats] -> ShowS
DatasetImageStats -> String
(Int -> DatasetImageStats -> ShowS)
-> (DatasetImageStats -> String)
-> ([DatasetImageStats] -> ShowS)
-> Show DatasetImageStats
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatasetImageStats] -> ShowS
$cshowList :: [DatasetImageStats] -> ShowS
show :: DatasetImageStats -> String
$cshow :: DatasetImageStats -> String
showsPrec :: Int -> DatasetImageStats -> ShowS
$cshowsPrec :: Int -> DatasetImageStats -> ShowS
Prelude.Show, (forall x. DatasetImageStats -> Rep DatasetImageStats x)
-> (forall x. Rep DatasetImageStats x -> DatasetImageStats)
-> Generic DatasetImageStats
forall x. Rep DatasetImageStats x -> DatasetImageStats
forall x. DatasetImageStats -> Rep DatasetImageStats x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatasetImageStats x -> DatasetImageStats
$cfrom :: forall x. DatasetImageStats -> Rep DatasetImageStats x
Prelude.Generic)

-- |
-- Create a value of 'DatasetImageStats' 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:
--
-- 'normal', 'datasetImageStats_normal' - The total number of images labeled as normal.
--
-- 'anomaly', 'datasetImageStats_anomaly' - the total number of images labeled as an anomaly.
--
-- 'labeled', 'datasetImageStats_labeled' - The total number of labeled images.
--
-- 'total', 'datasetImageStats_total' - The total number of images in the dataset.
newDatasetImageStats ::
  DatasetImageStats
newDatasetImageStats :: DatasetImageStats
newDatasetImageStats =
  DatasetImageStats' :: Maybe Int
-> Maybe Int -> Maybe Int -> Maybe Int -> DatasetImageStats
DatasetImageStats'
    { $sel:normal:DatasetImageStats' :: Maybe Int
normal = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:anomaly:DatasetImageStats' :: Maybe Int
anomaly = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:labeled:DatasetImageStats' :: Maybe Int
labeled = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:total:DatasetImageStats' :: Maybe Int
total = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The total number of images labeled as normal.
datasetImageStats_normal :: Lens.Lens' DatasetImageStats (Prelude.Maybe Prelude.Int)
datasetImageStats_normal :: (Maybe Int -> f (Maybe Int))
-> DatasetImageStats -> f DatasetImageStats
datasetImageStats_normal = (DatasetImageStats -> Maybe Int)
-> (DatasetImageStats -> Maybe Int -> DatasetImageStats)
-> Lens DatasetImageStats DatasetImageStats (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetImageStats' {Maybe Int
normal :: Maybe Int
$sel:normal:DatasetImageStats' :: DatasetImageStats -> Maybe Int
normal} -> Maybe Int
normal) (\s :: DatasetImageStats
s@DatasetImageStats' {} Maybe Int
a -> DatasetImageStats
s {$sel:normal:DatasetImageStats' :: Maybe Int
normal = Maybe Int
a} :: DatasetImageStats)

-- | the total number of images labeled as an anomaly.
datasetImageStats_anomaly :: Lens.Lens' DatasetImageStats (Prelude.Maybe Prelude.Int)
datasetImageStats_anomaly :: (Maybe Int -> f (Maybe Int))
-> DatasetImageStats -> f DatasetImageStats
datasetImageStats_anomaly = (DatasetImageStats -> Maybe Int)
-> (DatasetImageStats -> Maybe Int -> DatasetImageStats)
-> Lens DatasetImageStats DatasetImageStats (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetImageStats' {Maybe Int
anomaly :: Maybe Int
$sel:anomaly:DatasetImageStats' :: DatasetImageStats -> Maybe Int
anomaly} -> Maybe Int
anomaly) (\s :: DatasetImageStats
s@DatasetImageStats' {} Maybe Int
a -> DatasetImageStats
s {$sel:anomaly:DatasetImageStats' :: Maybe Int
anomaly = Maybe Int
a} :: DatasetImageStats)

-- | The total number of labeled images.
datasetImageStats_labeled :: Lens.Lens' DatasetImageStats (Prelude.Maybe Prelude.Int)
datasetImageStats_labeled :: (Maybe Int -> f (Maybe Int))
-> DatasetImageStats -> f DatasetImageStats
datasetImageStats_labeled = (DatasetImageStats -> Maybe Int)
-> (DatasetImageStats -> Maybe Int -> DatasetImageStats)
-> Lens DatasetImageStats DatasetImageStats (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetImageStats' {Maybe Int
labeled :: Maybe Int
$sel:labeled:DatasetImageStats' :: DatasetImageStats -> Maybe Int
labeled} -> Maybe Int
labeled) (\s :: DatasetImageStats
s@DatasetImageStats' {} Maybe Int
a -> DatasetImageStats
s {$sel:labeled:DatasetImageStats' :: Maybe Int
labeled = Maybe Int
a} :: DatasetImageStats)

-- | The total number of images in the dataset.
datasetImageStats_total :: Lens.Lens' DatasetImageStats (Prelude.Maybe Prelude.Int)
datasetImageStats_total :: (Maybe Int -> f (Maybe Int))
-> DatasetImageStats -> f DatasetImageStats
datasetImageStats_total = (DatasetImageStats -> Maybe Int)
-> (DatasetImageStats -> Maybe Int -> DatasetImageStats)
-> Lens DatasetImageStats DatasetImageStats (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetImageStats' {Maybe Int
total :: Maybe Int
$sel:total:DatasetImageStats' :: DatasetImageStats -> Maybe Int
total} -> Maybe Int
total) (\s :: DatasetImageStats
s@DatasetImageStats' {} Maybe Int
a -> DatasetImageStats
s {$sel:total:DatasetImageStats' :: Maybe Int
total = Maybe Int
a} :: DatasetImageStats)

instance Core.FromJSON DatasetImageStats where
  parseJSON :: Value -> Parser DatasetImageStats
parseJSON =
    String
-> (Object -> Parser DatasetImageStats)
-> Value
-> Parser DatasetImageStats
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DatasetImageStats"
      ( \Object
x ->
          Maybe Int
-> Maybe Int -> Maybe Int -> Maybe Int -> DatasetImageStats
DatasetImageStats'
            (Maybe Int
 -> Maybe Int -> Maybe Int -> Maybe Int -> DatasetImageStats)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int -> Maybe Int -> Maybe Int -> DatasetImageStats)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Normal")
            Parser (Maybe Int -> Maybe Int -> Maybe Int -> DatasetImageStats)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Int -> DatasetImageStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Anomaly")
            Parser (Maybe Int -> Maybe Int -> DatasetImageStats)
-> Parser (Maybe Int) -> Parser (Maybe Int -> DatasetImageStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Labeled")
            Parser (Maybe Int -> DatasetImageStats)
-> Parser (Maybe Int) -> Parser DatasetImageStats
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Total")
      )

instance Prelude.Hashable DatasetImageStats

instance Prelude.NFData DatasetImageStats