{-# 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.Rekognition.Types.DatasetLabelDescription
-- 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.Rekognition.Types.DatasetLabelDescription 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
import Amazonka.Rekognition.Types.DatasetLabelStats

-- | Describes a dataset label. For more information, see ListDatasetLabels.
--
-- /See:/ 'newDatasetLabelDescription' smart constructor.
data DatasetLabelDescription = DatasetLabelDescription'
  { -- | The name of the label.
    DatasetLabelDescription -> Maybe Text
labelName :: Prelude.Maybe Prelude.Text,
    -- | Statistics about the label.
    DatasetLabelDescription -> Maybe DatasetLabelStats
labelStats :: Prelude.Maybe DatasetLabelStats
  }
  deriving (DatasetLabelDescription -> DatasetLabelDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatasetLabelDescription -> DatasetLabelDescription -> Bool
$c/= :: DatasetLabelDescription -> DatasetLabelDescription -> Bool
== :: DatasetLabelDescription -> DatasetLabelDescription -> Bool
$c== :: DatasetLabelDescription -> DatasetLabelDescription -> Bool
Prelude.Eq, ReadPrec [DatasetLabelDescription]
ReadPrec DatasetLabelDescription
Int -> ReadS DatasetLabelDescription
ReadS [DatasetLabelDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatasetLabelDescription]
$creadListPrec :: ReadPrec [DatasetLabelDescription]
readPrec :: ReadPrec DatasetLabelDescription
$creadPrec :: ReadPrec DatasetLabelDescription
readList :: ReadS [DatasetLabelDescription]
$creadList :: ReadS [DatasetLabelDescription]
readsPrec :: Int -> ReadS DatasetLabelDescription
$creadsPrec :: Int -> ReadS DatasetLabelDescription
Prelude.Read, Int -> DatasetLabelDescription -> ShowS
[DatasetLabelDescription] -> ShowS
DatasetLabelDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatasetLabelDescription] -> ShowS
$cshowList :: [DatasetLabelDescription] -> ShowS
show :: DatasetLabelDescription -> String
$cshow :: DatasetLabelDescription -> String
showsPrec :: Int -> DatasetLabelDescription -> ShowS
$cshowsPrec :: Int -> DatasetLabelDescription -> ShowS
Prelude.Show, forall x. Rep DatasetLabelDescription x -> DatasetLabelDescription
forall x. DatasetLabelDescription -> Rep DatasetLabelDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatasetLabelDescription x -> DatasetLabelDescription
$cfrom :: forall x. DatasetLabelDescription -> Rep DatasetLabelDescription x
Prelude.Generic)

-- |
-- Create a value of 'DatasetLabelDescription' 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:
--
-- 'labelName', 'datasetLabelDescription_labelName' - The name of the label.
--
-- 'labelStats', 'datasetLabelDescription_labelStats' - Statistics about the label.
newDatasetLabelDescription ::
  DatasetLabelDescription
newDatasetLabelDescription :: DatasetLabelDescription
newDatasetLabelDescription =
  DatasetLabelDescription'
    { $sel:labelName:DatasetLabelDescription' :: Maybe Text
labelName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:labelStats:DatasetLabelDescription' :: Maybe DatasetLabelStats
labelStats = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the label.
datasetLabelDescription_labelName :: Lens.Lens' DatasetLabelDescription (Prelude.Maybe Prelude.Text)
datasetLabelDescription_labelName :: Lens' DatasetLabelDescription (Maybe Text)
datasetLabelDescription_labelName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetLabelDescription' {Maybe Text
labelName :: Maybe Text
$sel:labelName:DatasetLabelDescription' :: DatasetLabelDescription -> Maybe Text
labelName} -> Maybe Text
labelName) (\s :: DatasetLabelDescription
s@DatasetLabelDescription' {} Maybe Text
a -> DatasetLabelDescription
s {$sel:labelName:DatasetLabelDescription' :: Maybe Text
labelName = Maybe Text
a} :: DatasetLabelDescription)

-- | Statistics about the label.
datasetLabelDescription_labelStats :: Lens.Lens' DatasetLabelDescription (Prelude.Maybe DatasetLabelStats)
datasetLabelDescription_labelStats :: Lens' DatasetLabelDescription (Maybe DatasetLabelStats)
datasetLabelDescription_labelStats = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetLabelDescription' {Maybe DatasetLabelStats
labelStats :: Maybe DatasetLabelStats
$sel:labelStats:DatasetLabelDescription' :: DatasetLabelDescription -> Maybe DatasetLabelStats
labelStats} -> Maybe DatasetLabelStats
labelStats) (\s :: DatasetLabelDescription
s@DatasetLabelDescription' {} Maybe DatasetLabelStats
a -> DatasetLabelDescription
s {$sel:labelStats:DatasetLabelDescription' :: Maybe DatasetLabelStats
labelStats = Maybe DatasetLabelStats
a} :: DatasetLabelDescription)

instance Data.FromJSON DatasetLabelDescription where
  parseJSON :: Value -> Parser DatasetLabelDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DatasetLabelDescription"
      ( \Object
x ->
          Maybe Text -> Maybe DatasetLabelStats -> DatasetLabelDescription
DatasetLabelDescription'
            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
"LabelName")
            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
"LabelStats")
      )

instance Prelude.Hashable DatasetLabelDescription where
  hashWithSalt :: Int -> DatasetLabelDescription -> Int
hashWithSalt Int
_salt DatasetLabelDescription' {Maybe Text
Maybe DatasetLabelStats
labelStats :: Maybe DatasetLabelStats
labelName :: Maybe Text
$sel:labelStats:DatasetLabelDescription' :: DatasetLabelDescription -> Maybe DatasetLabelStats
$sel:labelName:DatasetLabelDescription' :: DatasetLabelDescription -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
labelName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DatasetLabelStats
labelStats

instance Prelude.NFData DatasetLabelDescription where
  rnf :: DatasetLabelDescription -> ()
rnf DatasetLabelDescription' {Maybe Text
Maybe DatasetLabelStats
labelStats :: Maybe DatasetLabelStats
labelName :: Maybe Text
$sel:labelStats:DatasetLabelDescription' :: DatasetLabelDescription -> Maybe DatasetLabelStats
$sel:labelName:DatasetLabelDescription' :: DatasetLabelDescription -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
labelName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DatasetLabelStats
labelStats