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

import Amazonka.Connect.Types.VocabularyLanguageCode
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 information about a default vocabulary.
--
-- /See:/ 'newDefaultVocabulary' smart constructor.
data DefaultVocabulary = DefaultVocabulary'
  { -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    DefaultVocabulary -> Text
instanceId :: 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?>
    DefaultVocabulary -> VocabularyLanguageCode
languageCode :: VocabularyLanguageCode,
    -- | The identifier of the custom vocabulary.
    DefaultVocabulary -> Text
vocabularyId :: Prelude.Text,
    -- | A unique name of the custom vocabulary.
    DefaultVocabulary -> Text
vocabularyName :: Prelude.Text
  }
  deriving (DefaultVocabulary -> DefaultVocabulary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefaultVocabulary -> DefaultVocabulary -> Bool
$c/= :: DefaultVocabulary -> DefaultVocabulary -> Bool
== :: DefaultVocabulary -> DefaultVocabulary -> Bool
$c== :: DefaultVocabulary -> DefaultVocabulary -> Bool
Prelude.Eq, ReadPrec [DefaultVocabulary]
ReadPrec DefaultVocabulary
Int -> ReadS DefaultVocabulary
ReadS [DefaultVocabulary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DefaultVocabulary]
$creadListPrec :: ReadPrec [DefaultVocabulary]
readPrec :: ReadPrec DefaultVocabulary
$creadPrec :: ReadPrec DefaultVocabulary
readList :: ReadS [DefaultVocabulary]
$creadList :: ReadS [DefaultVocabulary]
readsPrec :: Int -> ReadS DefaultVocabulary
$creadsPrec :: Int -> ReadS DefaultVocabulary
Prelude.Read, Int -> DefaultVocabulary -> ShowS
[DefaultVocabulary] -> ShowS
DefaultVocabulary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DefaultVocabulary] -> ShowS
$cshowList :: [DefaultVocabulary] -> ShowS
show :: DefaultVocabulary -> String
$cshow :: DefaultVocabulary -> String
showsPrec :: Int -> DefaultVocabulary -> ShowS
$cshowsPrec :: Int -> DefaultVocabulary -> ShowS
Prelude.Show, forall x. Rep DefaultVocabulary x -> DefaultVocabulary
forall x. DefaultVocabulary -> Rep DefaultVocabulary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DefaultVocabulary x -> DefaultVocabulary
$cfrom :: forall x. DefaultVocabulary -> Rep DefaultVocabulary x
Prelude.Generic)

-- |
-- Create a value of 'DefaultVocabulary' 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:
--
-- 'instanceId', 'defaultVocabulary_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'languageCode', 'defaultVocabulary_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?>
--
-- 'vocabularyId', 'defaultVocabulary_vocabularyId' - The identifier of the custom vocabulary.
--
-- 'vocabularyName', 'defaultVocabulary_vocabularyName' - A unique name of the custom vocabulary.
newDefaultVocabulary ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'languageCode'
  VocabularyLanguageCode ->
  -- | 'vocabularyId'
  Prelude.Text ->
  -- | 'vocabularyName'
  Prelude.Text ->
  DefaultVocabulary
newDefaultVocabulary :: Text -> VocabularyLanguageCode -> Text -> Text -> DefaultVocabulary
newDefaultVocabulary
  Text
pInstanceId_
  VocabularyLanguageCode
pLanguageCode_
  Text
pVocabularyId_
  Text
pVocabularyName_ =
    DefaultVocabulary'
      { $sel:instanceId:DefaultVocabulary' :: Text
instanceId = Text
pInstanceId_,
        $sel:languageCode:DefaultVocabulary' :: VocabularyLanguageCode
languageCode = VocabularyLanguageCode
pLanguageCode_,
        $sel:vocabularyId:DefaultVocabulary' :: Text
vocabularyId = Text
pVocabularyId_,
        $sel:vocabularyName:DefaultVocabulary' :: Text
vocabularyName = Text
pVocabularyName_
      }

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
defaultVocabulary_instanceId :: Lens.Lens' DefaultVocabulary Prelude.Text
defaultVocabulary_instanceId :: Lens' DefaultVocabulary Text
defaultVocabulary_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultVocabulary' {Text
instanceId :: Text
$sel:instanceId:DefaultVocabulary' :: DefaultVocabulary -> Text
instanceId} -> Text
instanceId) (\s :: DefaultVocabulary
s@DefaultVocabulary' {} Text
a -> DefaultVocabulary
s {$sel:instanceId:DefaultVocabulary' :: Text
instanceId = Text
a} :: DefaultVocabulary)

-- | 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?>
defaultVocabulary_languageCode :: Lens.Lens' DefaultVocabulary VocabularyLanguageCode
defaultVocabulary_languageCode :: Lens' DefaultVocabulary VocabularyLanguageCode
defaultVocabulary_languageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultVocabulary' {VocabularyLanguageCode
languageCode :: VocabularyLanguageCode
$sel:languageCode:DefaultVocabulary' :: DefaultVocabulary -> VocabularyLanguageCode
languageCode} -> VocabularyLanguageCode
languageCode) (\s :: DefaultVocabulary
s@DefaultVocabulary' {} VocabularyLanguageCode
a -> DefaultVocabulary
s {$sel:languageCode:DefaultVocabulary' :: VocabularyLanguageCode
languageCode = VocabularyLanguageCode
a} :: DefaultVocabulary)

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

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

instance Data.FromJSON DefaultVocabulary where
  parseJSON :: Value -> Parser DefaultVocabulary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DefaultVocabulary"
      ( \Object
x ->
          Text -> VocabularyLanguageCode -> Text -> Text -> DefaultVocabulary
DefaultVocabulary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"InstanceId")
            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
"VocabularyId")
            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
"VocabularyName")
      )

instance Prelude.Hashable DefaultVocabulary where
  hashWithSalt :: Int -> DefaultVocabulary -> Int
hashWithSalt Int
_salt DefaultVocabulary' {Text
VocabularyLanguageCode
vocabularyName :: Text
vocabularyId :: Text
languageCode :: VocabularyLanguageCode
instanceId :: Text
$sel:vocabularyName:DefaultVocabulary' :: DefaultVocabulary -> Text
$sel:vocabularyId:DefaultVocabulary' :: DefaultVocabulary -> Text
$sel:languageCode:DefaultVocabulary' :: DefaultVocabulary -> VocabularyLanguageCode
$sel:instanceId:DefaultVocabulary' :: DefaultVocabulary -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VocabularyLanguageCode
languageCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vocabularyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vocabularyName

instance Prelude.NFData DefaultVocabulary where
  rnf :: DefaultVocabulary -> ()
rnf DefaultVocabulary' {Text
VocabularyLanguageCode
vocabularyName :: Text
vocabularyId :: Text
languageCode :: VocabularyLanguageCode
instanceId :: Text
$sel:vocabularyName:DefaultVocabulary' :: DefaultVocabulary -> Text
$sel:vocabularyId:DefaultVocabulary' :: DefaultVocabulary -> Text
$sel:languageCode:DefaultVocabulary' :: DefaultVocabulary -> VocabularyLanguageCode
$sel:instanceId:DefaultVocabulary' :: DefaultVocabulary -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId
      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 Text
vocabularyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vocabularyName