{-# 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.LexV2Models.Types.CustomVocabularyEntryId
-- 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.LexV2Models.Types.CustomVocabularyEntryId 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

-- | The unique entry identifier for the custom vocabulary items.
--
-- /See:/ 'newCustomVocabularyEntryId' smart constructor.
data CustomVocabularyEntryId = CustomVocabularyEntryId'
  { -- | The unique item identifier for the custom vocabulary items.
    CustomVocabularyEntryId -> Text
itemId :: Prelude.Text
  }
  deriving (CustomVocabularyEntryId -> CustomVocabularyEntryId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomVocabularyEntryId -> CustomVocabularyEntryId -> Bool
$c/= :: CustomVocabularyEntryId -> CustomVocabularyEntryId -> Bool
== :: CustomVocabularyEntryId -> CustomVocabularyEntryId -> Bool
$c== :: CustomVocabularyEntryId -> CustomVocabularyEntryId -> Bool
Prelude.Eq, ReadPrec [CustomVocabularyEntryId]
ReadPrec CustomVocabularyEntryId
Int -> ReadS CustomVocabularyEntryId
ReadS [CustomVocabularyEntryId]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomVocabularyEntryId]
$creadListPrec :: ReadPrec [CustomVocabularyEntryId]
readPrec :: ReadPrec CustomVocabularyEntryId
$creadPrec :: ReadPrec CustomVocabularyEntryId
readList :: ReadS [CustomVocabularyEntryId]
$creadList :: ReadS [CustomVocabularyEntryId]
readsPrec :: Int -> ReadS CustomVocabularyEntryId
$creadsPrec :: Int -> ReadS CustomVocabularyEntryId
Prelude.Read, Int -> CustomVocabularyEntryId -> ShowS
[CustomVocabularyEntryId] -> ShowS
CustomVocabularyEntryId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomVocabularyEntryId] -> ShowS
$cshowList :: [CustomVocabularyEntryId] -> ShowS
show :: CustomVocabularyEntryId -> String
$cshow :: CustomVocabularyEntryId -> String
showsPrec :: Int -> CustomVocabularyEntryId -> ShowS
$cshowsPrec :: Int -> CustomVocabularyEntryId -> ShowS
Prelude.Show, forall x. Rep CustomVocabularyEntryId x -> CustomVocabularyEntryId
forall x. CustomVocabularyEntryId -> Rep CustomVocabularyEntryId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomVocabularyEntryId x -> CustomVocabularyEntryId
$cfrom :: forall x. CustomVocabularyEntryId -> Rep CustomVocabularyEntryId x
Prelude.Generic)

-- |
-- Create a value of 'CustomVocabularyEntryId' 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:
--
-- 'itemId', 'customVocabularyEntryId_itemId' - The unique item identifier for the custom vocabulary items.
newCustomVocabularyEntryId ::
  -- | 'itemId'
  Prelude.Text ->
  CustomVocabularyEntryId
newCustomVocabularyEntryId :: Text -> CustomVocabularyEntryId
newCustomVocabularyEntryId Text
pItemId_ =
  CustomVocabularyEntryId' {$sel:itemId:CustomVocabularyEntryId' :: Text
itemId = Text
pItemId_}

-- | The unique item identifier for the custom vocabulary items.
customVocabularyEntryId_itemId :: Lens.Lens' CustomVocabularyEntryId Prelude.Text
customVocabularyEntryId_itemId :: Lens' CustomVocabularyEntryId Text
customVocabularyEntryId_itemId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomVocabularyEntryId' {Text
itemId :: Text
$sel:itemId:CustomVocabularyEntryId' :: CustomVocabularyEntryId -> Text
itemId} -> Text
itemId) (\s :: CustomVocabularyEntryId
s@CustomVocabularyEntryId' {} Text
a -> CustomVocabularyEntryId
s {$sel:itemId:CustomVocabularyEntryId' :: Text
itemId = Text
a} :: CustomVocabularyEntryId)

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

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

instance Data.ToJSON CustomVocabularyEntryId where
  toJSON :: CustomVocabularyEntryId -> Value
toJSON CustomVocabularyEntryId' {Text
itemId :: Text
$sel:itemId:CustomVocabularyEntryId' :: CustomVocabularyEntryId -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"itemId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
itemId)]
      )