{-# 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.Connect.Types.VocabularySummary
-- 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.Connect.Types.VocabularySummary where

import Amazonka.Connect.Types.VocabularyLanguageCode
import Amazonka.Connect.Types.VocabularyState
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

-- | Contains summary information about the custom vocabulary.
--
-- /See:/ 'newVocabularySummary' smart constructor.
data VocabularySummary = VocabularySummary'
  { -- | The reason why the custom vocabulary was not created.
    VocabularySummary -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | A unique name of the custom vocabulary.
    VocabularySummary -> Text
name :: Prelude.Text,
    -- | The identifier of the custom vocabulary.
    VocabularySummary -> Text
id :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the custom vocabulary.
    VocabularySummary -> Text
arn :: Prelude.Text,
    -- | The language code of the vocabulary entries. For a list of languages and
    -- their corresponding language codes, see
    -- <https://docs.aws.amazon.com/transcribe/latest/dg/transcribe-whatis.html What is Amazon Transcribe?>
    VocabularySummary -> VocabularyLanguageCode
languageCode :: VocabularyLanguageCode,
    -- | The current state of the custom vocabulary.
    VocabularySummary -> VocabularyState
state :: VocabularyState,
    -- | The timestamp when the custom vocabulary was last modified.
    VocabularySummary -> POSIX
lastModifiedTime :: Data.POSIX
  }
  deriving (VocabularySummary -> VocabularySummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VocabularySummary -> VocabularySummary -> Bool
$c/= :: VocabularySummary -> VocabularySummary -> Bool
== :: VocabularySummary -> VocabularySummary -> Bool
$c== :: VocabularySummary -> VocabularySummary -> Bool
Prelude.Eq, ReadPrec [VocabularySummary]
ReadPrec VocabularySummary
Int -> ReadS VocabularySummary
ReadS [VocabularySummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VocabularySummary]
$creadListPrec :: ReadPrec [VocabularySummary]
readPrec :: ReadPrec VocabularySummary
$creadPrec :: ReadPrec VocabularySummary
readList :: ReadS [VocabularySummary]
$creadList :: ReadS [VocabularySummary]
readsPrec :: Int -> ReadS VocabularySummary
$creadsPrec :: Int -> ReadS VocabularySummary
Prelude.Read, Int -> VocabularySummary -> ShowS
[VocabularySummary] -> ShowS
VocabularySummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VocabularySummary] -> ShowS
$cshowList :: [VocabularySummary] -> ShowS
show :: VocabularySummary -> String
$cshow :: VocabularySummary -> String
showsPrec :: Int -> VocabularySummary -> ShowS
$cshowsPrec :: Int -> VocabularySummary -> ShowS
Prelude.Show, forall x. Rep VocabularySummary x -> VocabularySummary
forall x. VocabularySummary -> Rep VocabularySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VocabularySummary x -> VocabularySummary
$cfrom :: forall x. VocabularySummary -> Rep VocabularySummary x
Prelude.Generic)

-- |
-- Create a value of 'VocabularySummary' 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:
--
-- 'failureReason', 'vocabularySummary_failureReason' - The reason why the custom vocabulary was not created.
--
-- 'name', 'vocabularySummary_name' - A unique name of the custom vocabulary.
--
-- 'id', 'vocabularySummary_id' - The identifier of the custom vocabulary.
--
-- 'arn', 'vocabularySummary_arn' - The Amazon Resource Name (ARN) of the custom vocabulary.
--
-- 'languageCode', 'vocabularySummary_languageCode' - The language code of the vocabulary entries. For a list of languages and
-- their corresponding language codes, see
-- <https://docs.aws.amazon.com/transcribe/latest/dg/transcribe-whatis.html What is Amazon Transcribe?>
--
-- 'state', 'vocabularySummary_state' - The current state of the custom vocabulary.
--
-- 'lastModifiedTime', 'vocabularySummary_lastModifiedTime' - The timestamp when the custom vocabulary was last modified.
newVocabularySummary ::
  -- | 'name'
  Prelude.Text ->
  -- | 'id'
  Prelude.Text ->
  -- | 'arn'
  Prelude.Text ->
  -- | 'languageCode'
  VocabularyLanguageCode ->
  -- | 'state'
  VocabularyState ->
  -- | 'lastModifiedTime'
  Prelude.UTCTime ->
  VocabularySummary
newVocabularySummary :: Text
-> Text
-> Text
-> VocabularyLanguageCode
-> VocabularyState
-> UTCTime
-> VocabularySummary
newVocabularySummary
  Text
pName_
  Text
pId_
  Text
pArn_
  VocabularyLanguageCode
pLanguageCode_
  VocabularyState
pState_
  UTCTime
pLastModifiedTime_ =
    VocabularySummary'
      { $sel:failureReason:VocabularySummary' :: Maybe Text
failureReason = forall a. Maybe a
Prelude.Nothing,
        $sel:name:VocabularySummary' :: Text
name = Text
pName_,
        $sel:id:VocabularySummary' :: Text
id = Text
pId_,
        $sel:arn:VocabularySummary' :: Text
arn = Text
pArn_,
        $sel:languageCode:VocabularySummary' :: VocabularyLanguageCode
languageCode = VocabularyLanguageCode
pLanguageCode_,
        $sel:state:VocabularySummary' :: VocabularyState
state = VocabularyState
pState_,
        $sel:lastModifiedTime:VocabularySummary' :: POSIX
lastModifiedTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedTime_
      }

-- | The reason why the custom vocabulary was not created.
vocabularySummary_failureReason :: Lens.Lens' VocabularySummary (Prelude.Maybe Prelude.Text)
vocabularySummary_failureReason :: Lens' VocabularySummary (Maybe Text)
vocabularySummary_failureReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VocabularySummary' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:VocabularySummary' :: VocabularySummary -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: VocabularySummary
s@VocabularySummary' {} Maybe Text
a -> VocabularySummary
s {$sel:failureReason:VocabularySummary' :: Maybe Text
failureReason = Maybe Text
a} :: VocabularySummary)

-- | A unique name of the custom vocabulary.
vocabularySummary_name :: Lens.Lens' VocabularySummary Prelude.Text
vocabularySummary_name :: Lens' VocabularySummary Text
vocabularySummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VocabularySummary' {Text
name :: Text
$sel:name:VocabularySummary' :: VocabularySummary -> Text
name} -> Text
name) (\s :: VocabularySummary
s@VocabularySummary' {} Text
a -> VocabularySummary
s {$sel:name:VocabularySummary' :: Text
name = Text
a} :: VocabularySummary)

-- | The identifier of the custom vocabulary.
vocabularySummary_id :: Lens.Lens' VocabularySummary Prelude.Text
vocabularySummary_id :: Lens' VocabularySummary Text
vocabularySummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VocabularySummary' {Text
id :: Text
$sel:id:VocabularySummary' :: VocabularySummary -> Text
id} -> Text
id) (\s :: VocabularySummary
s@VocabularySummary' {} Text
a -> VocabularySummary
s {$sel:id:VocabularySummary' :: Text
id = Text
a} :: VocabularySummary)

-- | The Amazon Resource Name (ARN) of the custom vocabulary.
vocabularySummary_arn :: Lens.Lens' VocabularySummary Prelude.Text
vocabularySummary_arn :: Lens' VocabularySummary Text
vocabularySummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VocabularySummary' {Text
arn :: Text
$sel:arn:VocabularySummary' :: VocabularySummary -> Text
arn} -> Text
arn) (\s :: VocabularySummary
s@VocabularySummary' {} Text
a -> VocabularySummary
s {$sel:arn:VocabularySummary' :: Text
arn = Text
a} :: VocabularySummary)

-- | The language code of the vocabulary entries. For a list of languages and
-- their corresponding language codes, see
-- <https://docs.aws.amazon.com/transcribe/latest/dg/transcribe-whatis.html What is Amazon Transcribe?>
vocabularySummary_languageCode :: Lens.Lens' VocabularySummary VocabularyLanguageCode
vocabularySummary_languageCode :: Lens' VocabularySummary VocabularyLanguageCode
vocabularySummary_languageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VocabularySummary' {VocabularyLanguageCode
languageCode :: VocabularyLanguageCode
$sel:languageCode:VocabularySummary' :: VocabularySummary -> VocabularyLanguageCode
languageCode} -> VocabularyLanguageCode
languageCode) (\s :: VocabularySummary
s@VocabularySummary' {} VocabularyLanguageCode
a -> VocabularySummary
s {$sel:languageCode:VocabularySummary' :: VocabularyLanguageCode
languageCode = VocabularyLanguageCode
a} :: VocabularySummary)

-- | The current state of the custom vocabulary.
vocabularySummary_state :: Lens.Lens' VocabularySummary VocabularyState
vocabularySummary_state :: Lens' VocabularySummary VocabularyState
vocabularySummary_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VocabularySummary' {VocabularyState
state :: VocabularyState
$sel:state:VocabularySummary' :: VocabularySummary -> VocabularyState
state} -> VocabularyState
state) (\s :: VocabularySummary
s@VocabularySummary' {} VocabularyState
a -> VocabularySummary
s {$sel:state:VocabularySummary' :: VocabularyState
state = VocabularyState
a} :: VocabularySummary)

-- | The timestamp when the custom vocabulary was last modified.
vocabularySummary_lastModifiedTime :: Lens.Lens' VocabularySummary Prelude.UTCTime
vocabularySummary_lastModifiedTime :: Lens' VocabularySummary UTCTime
vocabularySummary_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VocabularySummary' {POSIX
lastModifiedTime :: POSIX
$sel:lastModifiedTime:VocabularySummary' :: VocabularySummary -> POSIX
lastModifiedTime} -> POSIX
lastModifiedTime) (\s :: VocabularySummary
s@VocabularySummary' {} POSIX
a -> VocabularySummary
s {$sel:lastModifiedTime:VocabularySummary' :: POSIX
lastModifiedTime = POSIX
a} :: VocabularySummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON VocabularySummary where
  parseJSON :: Value -> Parser VocabularySummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VocabularySummary"
      ( \Object
x ->
          Maybe Text
-> Text
-> Text
-> Text
-> VocabularyLanguageCode
-> VocabularyState
-> POSIX
-> VocabularySummary
VocabularySummary'
            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
"FailureReason")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"LanguageCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"State")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"LastModifiedTime")
      )

instance Prelude.Hashable VocabularySummary where
  hashWithSalt :: Int -> VocabularySummary -> Int
hashWithSalt Int
_salt VocabularySummary' {Maybe Text
Text
POSIX
VocabularyLanguageCode
VocabularyState
lastModifiedTime :: POSIX
state :: VocabularyState
languageCode :: VocabularyLanguageCode
arn :: Text
id :: Text
name :: Text
failureReason :: Maybe Text
$sel:lastModifiedTime:VocabularySummary' :: VocabularySummary -> POSIX
$sel:state:VocabularySummary' :: VocabularySummary -> VocabularyState
$sel:languageCode:VocabularySummary' :: VocabularySummary -> VocabularyLanguageCode
$sel:arn:VocabularySummary' :: VocabularySummary -> Text
$sel:id:VocabularySummary' :: VocabularySummary -> Text
$sel:name:VocabularySummary' :: VocabularySummary -> Text
$sel:failureReason:VocabularySummary' :: VocabularySummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
failureReason
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VocabularyLanguageCode
languageCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VocabularyState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
lastModifiedTime

instance Prelude.NFData VocabularySummary where
  rnf :: VocabularySummary -> ()
rnf VocabularySummary' {Maybe Text
Text
POSIX
VocabularyLanguageCode
VocabularyState
lastModifiedTime :: POSIX
state :: VocabularyState
languageCode :: VocabularyLanguageCode
arn :: Text
id :: Text
name :: Text
failureReason :: Maybe Text
$sel:lastModifiedTime:VocabularySummary' :: VocabularySummary -> POSIX
$sel:state:VocabularySummary' :: VocabularySummary -> VocabularyState
$sel:languageCode:VocabularySummary' :: VocabularySummary -> VocabularyLanguageCode
$sel:arn:VocabularySummary' :: VocabularySummary -> Text
$sel:id:VocabularySummary' :: VocabularySummary -> Text
$sel:name:VocabularySummary' :: VocabularySummary -> Text
$sel:failureReason:VocabularySummary' :: VocabularySummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
failureReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VocabularyLanguageCode
languageCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VocabularyState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
lastModifiedTime