{-# 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.FailedCustomVocabularyItem
-- 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.FailedCustomVocabularyItem where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types.ErrorCode
import qualified Amazonka.Prelude as Prelude

-- | The unique failed custom vocabulary item from the custom vocabulary
-- list.
--
-- /See:/ 'newFailedCustomVocabularyItem' smart constructor.
data FailedCustomVocabularyItem = FailedCustomVocabularyItem'
  { -- | The unique error code for the failed custom vocabulary item from the
    -- custom vocabulary list.
    FailedCustomVocabularyItem -> Maybe ErrorCode
errorCode :: Prelude.Maybe ErrorCode,
    -- | The error message for the failed custom vocabulary item from the custom
    -- vocabulary list.
    FailedCustomVocabularyItem -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | The unique item identifer for the failed custom vocabulary item from the
    -- custom vocabulary list.
    FailedCustomVocabularyItem -> Maybe Text
itemId :: Prelude.Maybe Prelude.Text
  }
  deriving (FailedCustomVocabularyItem -> FailedCustomVocabularyItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailedCustomVocabularyItem -> FailedCustomVocabularyItem -> Bool
$c/= :: FailedCustomVocabularyItem -> FailedCustomVocabularyItem -> Bool
== :: FailedCustomVocabularyItem -> FailedCustomVocabularyItem -> Bool
$c== :: FailedCustomVocabularyItem -> FailedCustomVocabularyItem -> Bool
Prelude.Eq, ReadPrec [FailedCustomVocabularyItem]
ReadPrec FailedCustomVocabularyItem
Int -> ReadS FailedCustomVocabularyItem
ReadS [FailedCustomVocabularyItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailedCustomVocabularyItem]
$creadListPrec :: ReadPrec [FailedCustomVocabularyItem]
readPrec :: ReadPrec FailedCustomVocabularyItem
$creadPrec :: ReadPrec FailedCustomVocabularyItem
readList :: ReadS [FailedCustomVocabularyItem]
$creadList :: ReadS [FailedCustomVocabularyItem]
readsPrec :: Int -> ReadS FailedCustomVocabularyItem
$creadsPrec :: Int -> ReadS FailedCustomVocabularyItem
Prelude.Read, Int -> FailedCustomVocabularyItem -> ShowS
[FailedCustomVocabularyItem] -> ShowS
FailedCustomVocabularyItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailedCustomVocabularyItem] -> ShowS
$cshowList :: [FailedCustomVocabularyItem] -> ShowS
show :: FailedCustomVocabularyItem -> String
$cshow :: FailedCustomVocabularyItem -> String
showsPrec :: Int -> FailedCustomVocabularyItem -> ShowS
$cshowsPrec :: Int -> FailedCustomVocabularyItem -> ShowS
Prelude.Show, forall x.
Rep FailedCustomVocabularyItem x -> FailedCustomVocabularyItem
forall x.
FailedCustomVocabularyItem -> Rep FailedCustomVocabularyItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FailedCustomVocabularyItem x -> FailedCustomVocabularyItem
$cfrom :: forall x.
FailedCustomVocabularyItem -> Rep FailedCustomVocabularyItem x
Prelude.Generic)

-- |
-- Create a value of 'FailedCustomVocabularyItem' 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:
--
-- 'errorCode', 'failedCustomVocabularyItem_errorCode' - The unique error code for the failed custom vocabulary item from the
-- custom vocabulary list.
--
-- 'errorMessage', 'failedCustomVocabularyItem_errorMessage' - The error message for the failed custom vocabulary item from the custom
-- vocabulary list.
--
-- 'itemId', 'failedCustomVocabularyItem_itemId' - The unique item identifer for the failed custom vocabulary item from the
-- custom vocabulary list.
newFailedCustomVocabularyItem ::
  FailedCustomVocabularyItem
newFailedCustomVocabularyItem :: FailedCustomVocabularyItem
newFailedCustomVocabularyItem =
  FailedCustomVocabularyItem'
    { $sel:errorCode:FailedCustomVocabularyItem' :: Maybe ErrorCode
errorCode =
        forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:FailedCustomVocabularyItem' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:itemId:FailedCustomVocabularyItem' :: Maybe Text
itemId = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique error code for the failed custom vocabulary item from the
-- custom vocabulary list.
failedCustomVocabularyItem_errorCode :: Lens.Lens' FailedCustomVocabularyItem (Prelude.Maybe ErrorCode)
failedCustomVocabularyItem_errorCode :: Lens' FailedCustomVocabularyItem (Maybe ErrorCode)
failedCustomVocabularyItem_errorCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedCustomVocabularyItem' {Maybe ErrorCode
errorCode :: Maybe ErrorCode
$sel:errorCode:FailedCustomVocabularyItem' :: FailedCustomVocabularyItem -> Maybe ErrorCode
errorCode} -> Maybe ErrorCode
errorCode) (\s :: FailedCustomVocabularyItem
s@FailedCustomVocabularyItem' {} Maybe ErrorCode
a -> FailedCustomVocabularyItem
s {$sel:errorCode:FailedCustomVocabularyItem' :: Maybe ErrorCode
errorCode = Maybe ErrorCode
a} :: FailedCustomVocabularyItem)

-- | The error message for the failed custom vocabulary item from the custom
-- vocabulary list.
failedCustomVocabularyItem_errorMessage :: Lens.Lens' FailedCustomVocabularyItem (Prelude.Maybe Prelude.Text)
failedCustomVocabularyItem_errorMessage :: Lens' FailedCustomVocabularyItem (Maybe Text)
failedCustomVocabularyItem_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedCustomVocabularyItem' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:FailedCustomVocabularyItem' :: FailedCustomVocabularyItem -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: FailedCustomVocabularyItem
s@FailedCustomVocabularyItem' {} Maybe Text
a -> FailedCustomVocabularyItem
s {$sel:errorMessage:FailedCustomVocabularyItem' :: Maybe Text
errorMessage = Maybe Text
a} :: FailedCustomVocabularyItem)

-- | The unique item identifer for the failed custom vocabulary item from the
-- custom vocabulary list.
failedCustomVocabularyItem_itemId :: Lens.Lens' FailedCustomVocabularyItem (Prelude.Maybe Prelude.Text)
failedCustomVocabularyItem_itemId :: Lens' FailedCustomVocabularyItem (Maybe Text)
failedCustomVocabularyItem_itemId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedCustomVocabularyItem' {Maybe Text
itemId :: Maybe Text
$sel:itemId:FailedCustomVocabularyItem' :: FailedCustomVocabularyItem -> Maybe Text
itemId} -> Maybe Text
itemId) (\s :: FailedCustomVocabularyItem
s@FailedCustomVocabularyItem' {} Maybe Text
a -> FailedCustomVocabularyItem
s {$sel:itemId:FailedCustomVocabularyItem' :: Maybe Text
itemId = Maybe Text
a} :: FailedCustomVocabularyItem)

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

instance Prelude.Hashable FailedCustomVocabularyItem where
  hashWithSalt :: Int -> FailedCustomVocabularyItem -> Int
hashWithSalt Int
_salt FailedCustomVocabularyItem' {Maybe Text
Maybe ErrorCode
itemId :: Maybe Text
errorMessage :: Maybe Text
errorCode :: Maybe ErrorCode
$sel:itemId:FailedCustomVocabularyItem' :: FailedCustomVocabularyItem -> Maybe Text
$sel:errorMessage:FailedCustomVocabularyItem' :: FailedCustomVocabularyItem -> Maybe Text
$sel:errorCode:FailedCustomVocabularyItem' :: FailedCustomVocabularyItem -> Maybe ErrorCode
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ErrorCode
errorCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
itemId

instance Prelude.NFData FailedCustomVocabularyItem where
  rnf :: FailedCustomVocabularyItem -> ()
rnf FailedCustomVocabularyItem' {Maybe Text
Maybe ErrorCode
itemId :: Maybe Text
errorMessage :: Maybe Text
errorCode :: Maybe ErrorCode
$sel:itemId:FailedCustomVocabularyItem' :: FailedCustomVocabularyItem -> Maybe Text
$sel:errorMessage:FailedCustomVocabularyItem' :: FailedCustomVocabularyItem -> Maybe Text
$sel:errorCode:FailedCustomVocabularyItem' :: FailedCustomVocabularyItem -> Maybe ErrorCode
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ErrorCode
errorCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
itemId