{-# 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.Transcribe.Types.VocabularyFilterInfo
-- 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.Transcribe.Types.VocabularyFilterInfo 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
import Amazonka.Transcribe.Types.LanguageCode

-- | Provides information about a custom vocabulary filter, including the
-- language of the filter, when it was last modified, and its name.
--
-- /See:/ 'newVocabularyFilterInfo' smart constructor.
data VocabularyFilterInfo = VocabularyFilterInfo'
  { -- | The language code that represents the language of the entries in your
    -- vocabulary filter. Each custom vocabulary filter must contain terms in
    -- only one language.
    --
    -- A custom vocabulary filter can only be used to transcribe files in the
    -- same language as the filter. For example, if you create a custom
    -- vocabulary filter using US English (@en-US@), you can only apply this
    -- filter to files that contain English audio.
    --
    -- For a list of supported languages and their associated language codes,
    -- refer to the
    -- <https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html Supported languages>
    -- table.
    VocabularyFilterInfo -> Maybe LanguageCode
languageCode :: Prelude.Maybe LanguageCode,
    -- | The date and time the specified custom vocabulary filter was last
    -- modified.
    --
    -- Timestamps are in the format @YYYY-MM-DD\'T\'HH:MM:SS.SSSSSS-UTC@. For
    -- example, @2022-05-04T12:32:58.761000-07:00@ represents 12:32 PM UTC-7 on
    -- May 4, 2022.
    VocabularyFilterInfo -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.POSIX,
    -- | A unique name, chosen by you, for your custom vocabulary filter. This
    -- name is case sensitive, cannot contain spaces, and must be unique within
    -- an Amazon Web Services account.
    VocabularyFilterInfo -> Maybe Text
vocabularyFilterName :: Prelude.Maybe Prelude.Text
  }
  deriving (VocabularyFilterInfo -> VocabularyFilterInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VocabularyFilterInfo -> VocabularyFilterInfo -> Bool
$c/= :: VocabularyFilterInfo -> VocabularyFilterInfo -> Bool
== :: VocabularyFilterInfo -> VocabularyFilterInfo -> Bool
$c== :: VocabularyFilterInfo -> VocabularyFilterInfo -> Bool
Prelude.Eq, ReadPrec [VocabularyFilterInfo]
ReadPrec VocabularyFilterInfo
Int -> ReadS VocabularyFilterInfo
ReadS [VocabularyFilterInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VocabularyFilterInfo]
$creadListPrec :: ReadPrec [VocabularyFilterInfo]
readPrec :: ReadPrec VocabularyFilterInfo
$creadPrec :: ReadPrec VocabularyFilterInfo
readList :: ReadS [VocabularyFilterInfo]
$creadList :: ReadS [VocabularyFilterInfo]
readsPrec :: Int -> ReadS VocabularyFilterInfo
$creadsPrec :: Int -> ReadS VocabularyFilterInfo
Prelude.Read, Int -> VocabularyFilterInfo -> ShowS
[VocabularyFilterInfo] -> ShowS
VocabularyFilterInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VocabularyFilterInfo] -> ShowS
$cshowList :: [VocabularyFilterInfo] -> ShowS
show :: VocabularyFilterInfo -> String
$cshow :: VocabularyFilterInfo -> String
showsPrec :: Int -> VocabularyFilterInfo -> ShowS
$cshowsPrec :: Int -> VocabularyFilterInfo -> ShowS
Prelude.Show, forall x. Rep VocabularyFilterInfo x -> VocabularyFilterInfo
forall x. VocabularyFilterInfo -> Rep VocabularyFilterInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VocabularyFilterInfo x -> VocabularyFilterInfo
$cfrom :: forall x. VocabularyFilterInfo -> Rep VocabularyFilterInfo x
Prelude.Generic)

-- |
-- Create a value of 'VocabularyFilterInfo' 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:
--
-- 'languageCode', 'vocabularyFilterInfo_languageCode' - The language code that represents the language of the entries in your
-- vocabulary filter. Each custom vocabulary filter must contain terms in
-- only one language.
--
-- A custom vocabulary filter can only be used to transcribe files in the
-- same language as the filter. For example, if you create a custom
-- vocabulary filter using US English (@en-US@), you can only apply this
-- filter to files that contain English audio.
--
-- For a list of supported languages and their associated language codes,
-- refer to the
-- <https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html Supported languages>
-- table.
--
-- 'lastModifiedTime', 'vocabularyFilterInfo_lastModifiedTime' - The date and time the specified custom vocabulary filter was last
-- modified.
--
-- Timestamps are in the format @YYYY-MM-DD\'T\'HH:MM:SS.SSSSSS-UTC@. For
-- example, @2022-05-04T12:32:58.761000-07:00@ represents 12:32 PM UTC-7 on
-- May 4, 2022.
--
-- 'vocabularyFilterName', 'vocabularyFilterInfo_vocabularyFilterName' - A unique name, chosen by you, for your custom vocabulary filter. This
-- name is case sensitive, cannot contain spaces, and must be unique within
-- an Amazon Web Services account.
newVocabularyFilterInfo ::
  VocabularyFilterInfo
newVocabularyFilterInfo :: VocabularyFilterInfo
newVocabularyFilterInfo =
  VocabularyFilterInfo'
    { $sel:languageCode:VocabularyFilterInfo' :: Maybe LanguageCode
languageCode =
        forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:VocabularyFilterInfo' :: Maybe POSIX
lastModifiedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:vocabularyFilterName:VocabularyFilterInfo' :: Maybe Text
vocabularyFilterName = forall a. Maybe a
Prelude.Nothing
    }

-- | The language code that represents the language of the entries in your
-- vocabulary filter. Each custom vocabulary filter must contain terms in
-- only one language.
--
-- A custom vocabulary filter can only be used to transcribe files in the
-- same language as the filter. For example, if you create a custom
-- vocabulary filter using US English (@en-US@), you can only apply this
-- filter to files that contain English audio.
--
-- For a list of supported languages and their associated language codes,
-- refer to the
-- <https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html Supported languages>
-- table.
vocabularyFilterInfo_languageCode :: Lens.Lens' VocabularyFilterInfo (Prelude.Maybe LanguageCode)
vocabularyFilterInfo_languageCode :: Lens' VocabularyFilterInfo (Maybe LanguageCode)
vocabularyFilterInfo_languageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VocabularyFilterInfo' {Maybe LanguageCode
languageCode :: Maybe LanguageCode
$sel:languageCode:VocabularyFilterInfo' :: VocabularyFilterInfo -> Maybe LanguageCode
languageCode} -> Maybe LanguageCode
languageCode) (\s :: VocabularyFilterInfo
s@VocabularyFilterInfo' {} Maybe LanguageCode
a -> VocabularyFilterInfo
s {$sel:languageCode:VocabularyFilterInfo' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
a} :: VocabularyFilterInfo)

-- | The date and time the specified custom vocabulary filter was last
-- modified.
--
-- Timestamps are in the format @YYYY-MM-DD\'T\'HH:MM:SS.SSSSSS-UTC@. For
-- example, @2022-05-04T12:32:58.761000-07:00@ represents 12:32 PM UTC-7 on
-- May 4, 2022.
vocabularyFilterInfo_lastModifiedTime :: Lens.Lens' VocabularyFilterInfo (Prelude.Maybe Prelude.UTCTime)
vocabularyFilterInfo_lastModifiedTime :: Lens' VocabularyFilterInfo (Maybe UTCTime)
vocabularyFilterInfo_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VocabularyFilterInfo' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:VocabularyFilterInfo' :: VocabularyFilterInfo -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: VocabularyFilterInfo
s@VocabularyFilterInfo' {} Maybe POSIX
a -> VocabularyFilterInfo
s {$sel:lastModifiedTime:VocabularyFilterInfo' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: VocabularyFilterInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A unique name, chosen by you, for your custom vocabulary filter. This
-- name is case sensitive, cannot contain spaces, and must be unique within
-- an Amazon Web Services account.
vocabularyFilterInfo_vocabularyFilterName :: Lens.Lens' VocabularyFilterInfo (Prelude.Maybe Prelude.Text)
vocabularyFilterInfo_vocabularyFilterName :: Lens' VocabularyFilterInfo (Maybe Text)
vocabularyFilterInfo_vocabularyFilterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VocabularyFilterInfo' {Maybe Text
vocabularyFilterName :: Maybe Text
$sel:vocabularyFilterName:VocabularyFilterInfo' :: VocabularyFilterInfo -> Maybe Text
vocabularyFilterName} -> Maybe Text
vocabularyFilterName) (\s :: VocabularyFilterInfo
s@VocabularyFilterInfo' {} Maybe Text
a -> VocabularyFilterInfo
s {$sel:vocabularyFilterName:VocabularyFilterInfo' :: Maybe Text
vocabularyFilterName = Maybe Text
a} :: VocabularyFilterInfo)

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

instance Prelude.Hashable VocabularyFilterInfo where
  hashWithSalt :: Int -> VocabularyFilterInfo -> Int
hashWithSalt Int
_salt VocabularyFilterInfo' {Maybe Text
Maybe POSIX
Maybe LanguageCode
vocabularyFilterName :: Maybe Text
lastModifiedTime :: Maybe POSIX
languageCode :: Maybe LanguageCode
$sel:vocabularyFilterName:VocabularyFilterInfo' :: VocabularyFilterInfo -> Maybe Text
$sel:lastModifiedTime:VocabularyFilterInfo' :: VocabularyFilterInfo -> Maybe POSIX
$sel:languageCode:VocabularyFilterInfo' :: VocabularyFilterInfo -> Maybe LanguageCode
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LanguageCode
languageCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vocabularyFilterName

instance Prelude.NFData VocabularyFilterInfo where
  rnf :: VocabularyFilterInfo -> ()
rnf VocabularyFilterInfo' {Maybe Text
Maybe POSIX
Maybe LanguageCode
vocabularyFilterName :: Maybe Text
lastModifiedTime :: Maybe POSIX
languageCode :: Maybe LanguageCode
$sel:vocabularyFilterName:VocabularyFilterInfo' :: VocabularyFilterInfo -> Maybe Text
$sel:lastModifiedTime:VocabularyFilterInfo' :: VocabularyFilterInfo -> Maybe POSIX
$sel:languageCode:VocabularyFilterInfo' :: VocabularyFilterInfo -> Maybe LanguageCode
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe LanguageCode
languageCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vocabularyFilterName