{-# 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.TranscriptFilter
-- 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.TranscriptFilter 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.LexTranscriptFilter
import qualified Amazonka.Prelude as Prelude

-- | The object representing the filter that Amazon Lex will use to select
-- the appropriate transcript.
--
-- /See:/ 'newTranscriptFilter' smart constructor.
data TranscriptFilter = TranscriptFilter'
  { -- | The object representing the filter that Amazon Lex will use to select
    -- the appropriate transcript when the transcript format is the Amazon Lex
    -- format.
    TranscriptFilter -> Maybe LexTranscriptFilter
lexTranscriptFilter :: Prelude.Maybe LexTranscriptFilter
  }
  deriving (TranscriptFilter -> TranscriptFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TranscriptFilter -> TranscriptFilter -> Bool
$c/= :: TranscriptFilter -> TranscriptFilter -> Bool
== :: TranscriptFilter -> TranscriptFilter -> Bool
$c== :: TranscriptFilter -> TranscriptFilter -> Bool
Prelude.Eq, ReadPrec [TranscriptFilter]
ReadPrec TranscriptFilter
Int -> ReadS TranscriptFilter
ReadS [TranscriptFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TranscriptFilter]
$creadListPrec :: ReadPrec [TranscriptFilter]
readPrec :: ReadPrec TranscriptFilter
$creadPrec :: ReadPrec TranscriptFilter
readList :: ReadS [TranscriptFilter]
$creadList :: ReadS [TranscriptFilter]
readsPrec :: Int -> ReadS TranscriptFilter
$creadsPrec :: Int -> ReadS TranscriptFilter
Prelude.Read, Int -> TranscriptFilter -> ShowS
[TranscriptFilter] -> ShowS
TranscriptFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TranscriptFilter] -> ShowS
$cshowList :: [TranscriptFilter] -> ShowS
show :: TranscriptFilter -> String
$cshow :: TranscriptFilter -> String
showsPrec :: Int -> TranscriptFilter -> ShowS
$cshowsPrec :: Int -> TranscriptFilter -> ShowS
Prelude.Show, forall x. Rep TranscriptFilter x -> TranscriptFilter
forall x. TranscriptFilter -> Rep TranscriptFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TranscriptFilter x -> TranscriptFilter
$cfrom :: forall x. TranscriptFilter -> Rep TranscriptFilter x
Prelude.Generic)

-- |
-- Create a value of 'TranscriptFilter' 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:
--
-- 'lexTranscriptFilter', 'transcriptFilter_lexTranscriptFilter' - The object representing the filter that Amazon Lex will use to select
-- the appropriate transcript when the transcript format is the Amazon Lex
-- format.
newTranscriptFilter ::
  TranscriptFilter
newTranscriptFilter :: TranscriptFilter
newTranscriptFilter =
  TranscriptFilter'
    { $sel:lexTranscriptFilter:TranscriptFilter' :: Maybe LexTranscriptFilter
lexTranscriptFilter =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The object representing the filter that Amazon Lex will use to select
-- the appropriate transcript when the transcript format is the Amazon Lex
-- format.
transcriptFilter_lexTranscriptFilter :: Lens.Lens' TranscriptFilter (Prelude.Maybe LexTranscriptFilter)
transcriptFilter_lexTranscriptFilter :: Lens' TranscriptFilter (Maybe LexTranscriptFilter)
transcriptFilter_lexTranscriptFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TranscriptFilter' {Maybe LexTranscriptFilter
lexTranscriptFilter :: Maybe LexTranscriptFilter
$sel:lexTranscriptFilter:TranscriptFilter' :: TranscriptFilter -> Maybe LexTranscriptFilter
lexTranscriptFilter} -> Maybe LexTranscriptFilter
lexTranscriptFilter) (\s :: TranscriptFilter
s@TranscriptFilter' {} Maybe LexTranscriptFilter
a -> TranscriptFilter
s {$sel:lexTranscriptFilter:TranscriptFilter' :: Maybe LexTranscriptFilter
lexTranscriptFilter = Maybe LexTranscriptFilter
a} :: TranscriptFilter)

instance Data.FromJSON TranscriptFilter where
  parseJSON :: Value -> Parser TranscriptFilter
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TranscriptFilter"
      ( \Object
x ->
          Maybe LexTranscriptFilter -> TranscriptFilter
TranscriptFilter'
            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
"lexTranscriptFilter")
      )

instance Prelude.Hashable TranscriptFilter where
  hashWithSalt :: Int -> TranscriptFilter -> Int
hashWithSalt Int
_salt TranscriptFilter' {Maybe LexTranscriptFilter
lexTranscriptFilter :: Maybe LexTranscriptFilter
$sel:lexTranscriptFilter:TranscriptFilter' :: TranscriptFilter -> Maybe LexTranscriptFilter
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LexTranscriptFilter
lexTranscriptFilter

instance Prelude.NFData TranscriptFilter where
  rnf :: TranscriptFilter -> ()
rnf TranscriptFilter' {Maybe LexTranscriptFilter
lexTranscriptFilter :: Maybe LexTranscriptFilter
$sel:lexTranscriptFilter:TranscriptFilter' :: TranscriptFilter -> Maybe LexTranscriptFilter
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe LexTranscriptFilter
lexTranscriptFilter

instance Data.ToJSON TranscriptFilter where
  toJSON :: TranscriptFilter -> Value
toJSON TranscriptFilter' {Maybe LexTranscriptFilter
lexTranscriptFilter :: Maybe LexTranscriptFilter
$sel:lexTranscriptFilter:TranscriptFilter' :: TranscriptFilter -> Maybe LexTranscriptFilter
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"lexTranscriptFilter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LexTranscriptFilter
lexTranscriptFilter
          ]
      )