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

-- | A potential alias of for a given label.
--
-- /See:/ 'newLabelAlias' smart constructor.
data LabelAlias = LabelAlias'
  { -- | The name of an alias for a given label.
    LabelAlias -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (LabelAlias -> LabelAlias -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LabelAlias -> LabelAlias -> Bool
$c/= :: LabelAlias -> LabelAlias -> Bool
== :: LabelAlias -> LabelAlias -> Bool
$c== :: LabelAlias -> LabelAlias -> Bool
Prelude.Eq, ReadPrec [LabelAlias]
ReadPrec LabelAlias
Int -> ReadS LabelAlias
ReadS [LabelAlias]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LabelAlias]
$creadListPrec :: ReadPrec [LabelAlias]
readPrec :: ReadPrec LabelAlias
$creadPrec :: ReadPrec LabelAlias
readList :: ReadS [LabelAlias]
$creadList :: ReadS [LabelAlias]
readsPrec :: Int -> ReadS LabelAlias
$creadsPrec :: Int -> ReadS LabelAlias
Prelude.Read, Int -> LabelAlias -> ShowS
[LabelAlias] -> ShowS
LabelAlias -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabelAlias] -> ShowS
$cshowList :: [LabelAlias] -> ShowS
show :: LabelAlias -> String
$cshow :: LabelAlias -> String
showsPrec :: Int -> LabelAlias -> ShowS
$cshowsPrec :: Int -> LabelAlias -> ShowS
Prelude.Show, forall x. Rep LabelAlias x -> LabelAlias
forall x. LabelAlias -> Rep LabelAlias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LabelAlias x -> LabelAlias
$cfrom :: forall x. LabelAlias -> Rep LabelAlias x
Prelude.Generic)

-- |
-- Create a value of 'LabelAlias' 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:
--
-- 'name', 'labelAlias_name' - The name of an alias for a given label.
newLabelAlias ::
  LabelAlias
newLabelAlias :: LabelAlias
newLabelAlias = LabelAlias' {$sel:name:LabelAlias' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing}

-- | The name of an alias for a given label.
labelAlias_name :: Lens.Lens' LabelAlias (Prelude.Maybe Prelude.Text)
labelAlias_name :: Lens' LabelAlias (Maybe Text)
labelAlias_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelAlias' {Maybe Text
name :: Maybe Text
$sel:name:LabelAlias' :: LabelAlias -> Maybe Text
name} -> Maybe Text
name) (\s :: LabelAlias
s@LabelAlias' {} Maybe Text
a -> LabelAlias
s {$sel:name:LabelAlias' :: Maybe Text
name = Maybe Text
a} :: LabelAlias)

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

instance Prelude.Hashable LabelAlias where
  hashWithSalt :: Int -> LabelAlias -> Int
hashWithSalt Int
_salt LabelAlias' {Maybe Text
name :: Maybe Text
$sel:name:LabelAlias' :: LabelAlias -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData LabelAlias where
  rnf :: LabelAlias -> ()
rnf LabelAlias' {Maybe Text
name :: Maybe Text
$sel:name:LabelAlias' :: LabelAlias -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name