{-# 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.CallAnalyticsJobSettings
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Transcribe.Types.CallAnalyticsJobSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Transcribe.Types.ContentRedaction
import Amazonka.Transcribe.Types.LanguageCode
import Amazonka.Transcribe.Types.VocabularyFilterMethod

-- | Provides optional settings for the @CallAnalyticsJob@ operation.
--
-- /See:/ 'newCallAnalyticsJobSettings' smart constructor.
data CallAnalyticsJobSettings = CallAnalyticsJobSettings'
  { CallAnalyticsJobSettings -> Maybe ContentRedaction
contentRedaction :: Prelude.Maybe ContentRedaction,
    -- | When you run a call analytics job, you can specify the language spoken
    -- in the audio, or you can have Amazon Transcribe identify the language
    -- for you.
    --
    -- To specify a language, specify an array with one language code. If you
    -- don\'t know the language, you can leave this field blank and Amazon
    -- Transcribe will use machine learning to identify the language for you.
    -- To improve the ability of Amazon Transcribe to correctly identify the
    -- language, you can provide an array of the languages that can be present
    -- in the audio. Refer to
    -- <https://docs.aws.amazon.com/transcribe/latest/dg/how-it-works.html Supported languages and language-specific features>
    -- for additional information.
    CallAnalyticsJobSettings -> Maybe (NonEmpty LanguageCode)
languageOptions :: Prelude.Maybe (Prelude.NonEmpty LanguageCode),
    -- | The name of a vocabulary to use when processing the call analytics job.
    CallAnalyticsJobSettings -> Maybe Text
vocabularyName :: Prelude.Maybe Prelude.Text,
    -- | The structure used to describe a custom language model.
    CallAnalyticsJobSettings -> Maybe Text
languageModelName :: Prelude.Maybe Prelude.Text,
    -- | The name of the vocabulary filter to use when running a call analytics
    -- job. The filter that you specify must have the same language code as the
    -- analytics job.
    CallAnalyticsJobSettings -> Maybe Text
vocabularyFilterName :: Prelude.Maybe Prelude.Text,
    -- | Set to mask to remove filtered text from the transcript and replace it
    -- with three asterisks (\"***\") as placeholder text. Set to @remove@ to
    -- remove filtered text from the transcript without using placeholder text.
    -- Set to @tag@ to mark the word in the transcription output that matches
    -- the vocabulary filter. When you set the filter method to @tag@, the
    -- words matching your vocabulary filter are not masked or removed.
    CallAnalyticsJobSettings -> Maybe VocabularyFilterMethod
vocabularyFilterMethod :: Prelude.Maybe VocabularyFilterMethod
  }
  deriving (CallAnalyticsJobSettings -> CallAnalyticsJobSettings -> Bool
(CallAnalyticsJobSettings -> CallAnalyticsJobSettings -> Bool)
-> (CallAnalyticsJobSettings -> CallAnalyticsJobSettings -> Bool)
-> Eq CallAnalyticsJobSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CallAnalyticsJobSettings -> CallAnalyticsJobSettings -> Bool
$c/= :: CallAnalyticsJobSettings -> CallAnalyticsJobSettings -> Bool
== :: CallAnalyticsJobSettings -> CallAnalyticsJobSettings -> Bool
$c== :: CallAnalyticsJobSettings -> CallAnalyticsJobSettings -> Bool
Prelude.Eq, ReadPrec [CallAnalyticsJobSettings]
ReadPrec CallAnalyticsJobSettings
Int -> ReadS CallAnalyticsJobSettings
ReadS [CallAnalyticsJobSettings]
(Int -> ReadS CallAnalyticsJobSettings)
-> ReadS [CallAnalyticsJobSettings]
-> ReadPrec CallAnalyticsJobSettings
-> ReadPrec [CallAnalyticsJobSettings]
-> Read CallAnalyticsJobSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CallAnalyticsJobSettings]
$creadListPrec :: ReadPrec [CallAnalyticsJobSettings]
readPrec :: ReadPrec CallAnalyticsJobSettings
$creadPrec :: ReadPrec CallAnalyticsJobSettings
readList :: ReadS [CallAnalyticsJobSettings]
$creadList :: ReadS [CallAnalyticsJobSettings]
readsPrec :: Int -> ReadS CallAnalyticsJobSettings
$creadsPrec :: Int -> ReadS CallAnalyticsJobSettings
Prelude.Read, Int -> CallAnalyticsJobSettings -> ShowS
[CallAnalyticsJobSettings] -> ShowS
CallAnalyticsJobSettings -> String
(Int -> CallAnalyticsJobSettings -> ShowS)
-> (CallAnalyticsJobSettings -> String)
-> ([CallAnalyticsJobSettings] -> ShowS)
-> Show CallAnalyticsJobSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallAnalyticsJobSettings] -> ShowS
$cshowList :: [CallAnalyticsJobSettings] -> ShowS
show :: CallAnalyticsJobSettings -> String
$cshow :: CallAnalyticsJobSettings -> String
showsPrec :: Int -> CallAnalyticsJobSettings -> ShowS
$cshowsPrec :: Int -> CallAnalyticsJobSettings -> ShowS
Prelude.Show, (forall x.
 CallAnalyticsJobSettings -> Rep CallAnalyticsJobSettings x)
-> (forall x.
    Rep CallAnalyticsJobSettings x -> CallAnalyticsJobSettings)
-> Generic CallAnalyticsJobSettings
forall x.
Rep CallAnalyticsJobSettings x -> CallAnalyticsJobSettings
forall x.
CallAnalyticsJobSettings -> Rep CallAnalyticsJobSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CallAnalyticsJobSettings x -> CallAnalyticsJobSettings
$cfrom :: forall x.
CallAnalyticsJobSettings -> Rep CallAnalyticsJobSettings x
Prelude.Generic)

-- |
-- Create a value of 'CallAnalyticsJobSettings' 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:
--
-- 'contentRedaction', 'callAnalyticsJobSettings_contentRedaction' - Undocumented member.
--
-- 'languageOptions', 'callAnalyticsJobSettings_languageOptions' - When you run a call analytics job, you can specify the language spoken
-- in the audio, or you can have Amazon Transcribe identify the language
-- for you.
--
-- To specify a language, specify an array with one language code. If you
-- don\'t know the language, you can leave this field blank and Amazon
-- Transcribe will use machine learning to identify the language for you.
-- To improve the ability of Amazon Transcribe to correctly identify the
-- language, you can provide an array of the languages that can be present
-- in the audio. Refer to
-- <https://docs.aws.amazon.com/transcribe/latest/dg/how-it-works.html Supported languages and language-specific features>
-- for additional information.
--
-- 'vocabularyName', 'callAnalyticsJobSettings_vocabularyName' - The name of a vocabulary to use when processing the call analytics job.
--
-- 'languageModelName', 'callAnalyticsJobSettings_languageModelName' - The structure used to describe a custom language model.
--
-- 'vocabularyFilterName', 'callAnalyticsJobSettings_vocabularyFilterName' - The name of the vocabulary filter to use when running a call analytics
-- job. The filter that you specify must have the same language code as the
-- analytics job.
--
-- 'vocabularyFilterMethod', 'callAnalyticsJobSettings_vocabularyFilterMethod' - Set to mask to remove filtered text from the transcript and replace it
-- with three asterisks (\"***\") as placeholder text. Set to @remove@ to
-- remove filtered text from the transcript without using placeholder text.
-- Set to @tag@ to mark the word in the transcription output that matches
-- the vocabulary filter. When you set the filter method to @tag@, the
-- words matching your vocabulary filter are not masked or removed.
newCallAnalyticsJobSettings ::
  CallAnalyticsJobSettings
newCallAnalyticsJobSettings :: CallAnalyticsJobSettings
newCallAnalyticsJobSettings =
  CallAnalyticsJobSettings' :: Maybe ContentRedaction
-> Maybe (NonEmpty LanguageCode)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VocabularyFilterMethod
-> CallAnalyticsJobSettings
CallAnalyticsJobSettings'
    { $sel:contentRedaction:CallAnalyticsJobSettings' :: Maybe ContentRedaction
contentRedaction =
        Maybe ContentRedaction
forall a. Maybe a
Prelude.Nothing,
      $sel:languageOptions:CallAnalyticsJobSettings' :: Maybe (NonEmpty LanguageCode)
languageOptions = Maybe (NonEmpty LanguageCode)
forall a. Maybe a
Prelude.Nothing,
      $sel:vocabularyName:CallAnalyticsJobSettings' :: Maybe Text
vocabularyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:languageModelName:CallAnalyticsJobSettings' :: Maybe Text
languageModelName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vocabularyFilterName:CallAnalyticsJobSettings' :: Maybe Text
vocabularyFilterName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vocabularyFilterMethod:CallAnalyticsJobSettings' :: Maybe VocabularyFilterMethod
vocabularyFilterMethod = Maybe VocabularyFilterMethod
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
callAnalyticsJobSettings_contentRedaction :: Lens.Lens' CallAnalyticsJobSettings (Prelude.Maybe ContentRedaction)
callAnalyticsJobSettings_contentRedaction :: (Maybe ContentRedaction -> f (Maybe ContentRedaction))
-> CallAnalyticsJobSettings -> f CallAnalyticsJobSettings
callAnalyticsJobSettings_contentRedaction = (CallAnalyticsJobSettings -> Maybe ContentRedaction)
-> (CallAnalyticsJobSettings
    -> Maybe ContentRedaction -> CallAnalyticsJobSettings)
-> Lens
     CallAnalyticsJobSettings
     CallAnalyticsJobSettings
     (Maybe ContentRedaction)
     (Maybe ContentRedaction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CallAnalyticsJobSettings' {Maybe ContentRedaction
contentRedaction :: Maybe ContentRedaction
$sel:contentRedaction:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe ContentRedaction
contentRedaction} -> Maybe ContentRedaction
contentRedaction) (\s :: CallAnalyticsJobSettings
s@CallAnalyticsJobSettings' {} Maybe ContentRedaction
a -> CallAnalyticsJobSettings
s {$sel:contentRedaction:CallAnalyticsJobSettings' :: Maybe ContentRedaction
contentRedaction = Maybe ContentRedaction
a} :: CallAnalyticsJobSettings)

-- | When you run a call analytics job, you can specify the language spoken
-- in the audio, or you can have Amazon Transcribe identify the language
-- for you.
--
-- To specify a language, specify an array with one language code. If you
-- don\'t know the language, you can leave this field blank and Amazon
-- Transcribe will use machine learning to identify the language for you.
-- To improve the ability of Amazon Transcribe to correctly identify the
-- language, you can provide an array of the languages that can be present
-- in the audio. Refer to
-- <https://docs.aws.amazon.com/transcribe/latest/dg/how-it-works.html Supported languages and language-specific features>
-- for additional information.
callAnalyticsJobSettings_languageOptions :: Lens.Lens' CallAnalyticsJobSettings (Prelude.Maybe (Prelude.NonEmpty LanguageCode))
callAnalyticsJobSettings_languageOptions :: (Maybe (NonEmpty LanguageCode)
 -> f (Maybe (NonEmpty LanguageCode)))
-> CallAnalyticsJobSettings -> f CallAnalyticsJobSettings
callAnalyticsJobSettings_languageOptions = (CallAnalyticsJobSettings -> Maybe (NonEmpty LanguageCode))
-> (CallAnalyticsJobSettings
    -> Maybe (NonEmpty LanguageCode) -> CallAnalyticsJobSettings)
-> Lens
     CallAnalyticsJobSettings
     CallAnalyticsJobSettings
     (Maybe (NonEmpty LanguageCode))
     (Maybe (NonEmpty LanguageCode))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CallAnalyticsJobSettings' {Maybe (NonEmpty LanguageCode)
languageOptions :: Maybe (NonEmpty LanguageCode)
$sel:languageOptions:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe (NonEmpty LanguageCode)
languageOptions} -> Maybe (NonEmpty LanguageCode)
languageOptions) (\s :: CallAnalyticsJobSettings
s@CallAnalyticsJobSettings' {} Maybe (NonEmpty LanguageCode)
a -> CallAnalyticsJobSettings
s {$sel:languageOptions:CallAnalyticsJobSettings' :: Maybe (NonEmpty LanguageCode)
languageOptions = Maybe (NonEmpty LanguageCode)
a} :: CallAnalyticsJobSettings) ((Maybe (NonEmpty LanguageCode)
  -> f (Maybe (NonEmpty LanguageCode)))
 -> CallAnalyticsJobSettings -> f CallAnalyticsJobSettings)
-> ((Maybe (NonEmpty LanguageCode)
     -> f (Maybe (NonEmpty LanguageCode)))
    -> Maybe (NonEmpty LanguageCode)
    -> f (Maybe (NonEmpty LanguageCode)))
-> (Maybe (NonEmpty LanguageCode)
    -> f (Maybe (NonEmpty LanguageCode)))
-> CallAnalyticsJobSettings
-> f CallAnalyticsJobSettings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty LanguageCode)
  (NonEmpty LanguageCode)
  (NonEmpty LanguageCode)
  (NonEmpty LanguageCode)
-> Iso
     (Maybe (NonEmpty LanguageCode))
     (Maybe (NonEmpty LanguageCode))
     (Maybe (NonEmpty LanguageCode))
     (Maybe (NonEmpty LanguageCode))
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 AnIso
  (NonEmpty LanguageCode)
  (NonEmpty LanguageCode)
  (NonEmpty LanguageCode)
  (NonEmpty LanguageCode)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of a vocabulary to use when processing the call analytics job.
callAnalyticsJobSettings_vocabularyName :: Lens.Lens' CallAnalyticsJobSettings (Prelude.Maybe Prelude.Text)
callAnalyticsJobSettings_vocabularyName :: (Maybe Text -> f (Maybe Text))
-> CallAnalyticsJobSettings -> f CallAnalyticsJobSettings
callAnalyticsJobSettings_vocabularyName = (CallAnalyticsJobSettings -> Maybe Text)
-> (CallAnalyticsJobSettings
    -> Maybe Text -> CallAnalyticsJobSettings)
-> Lens
     CallAnalyticsJobSettings
     CallAnalyticsJobSettings
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CallAnalyticsJobSettings' {Maybe Text
vocabularyName :: Maybe Text
$sel:vocabularyName:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe Text
vocabularyName} -> Maybe Text
vocabularyName) (\s :: CallAnalyticsJobSettings
s@CallAnalyticsJobSettings' {} Maybe Text
a -> CallAnalyticsJobSettings
s {$sel:vocabularyName:CallAnalyticsJobSettings' :: Maybe Text
vocabularyName = Maybe Text
a} :: CallAnalyticsJobSettings)

-- | The structure used to describe a custom language model.
callAnalyticsJobSettings_languageModelName :: Lens.Lens' CallAnalyticsJobSettings (Prelude.Maybe Prelude.Text)
callAnalyticsJobSettings_languageModelName :: (Maybe Text -> f (Maybe Text))
-> CallAnalyticsJobSettings -> f CallAnalyticsJobSettings
callAnalyticsJobSettings_languageModelName = (CallAnalyticsJobSettings -> Maybe Text)
-> (CallAnalyticsJobSettings
    -> Maybe Text -> CallAnalyticsJobSettings)
-> Lens
     CallAnalyticsJobSettings
     CallAnalyticsJobSettings
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CallAnalyticsJobSettings' {Maybe Text
languageModelName :: Maybe Text
$sel:languageModelName:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe Text
languageModelName} -> Maybe Text
languageModelName) (\s :: CallAnalyticsJobSettings
s@CallAnalyticsJobSettings' {} Maybe Text
a -> CallAnalyticsJobSettings
s {$sel:languageModelName:CallAnalyticsJobSettings' :: Maybe Text
languageModelName = Maybe Text
a} :: CallAnalyticsJobSettings)

-- | The name of the vocabulary filter to use when running a call analytics
-- job. The filter that you specify must have the same language code as the
-- analytics job.
callAnalyticsJobSettings_vocabularyFilterName :: Lens.Lens' CallAnalyticsJobSettings (Prelude.Maybe Prelude.Text)
callAnalyticsJobSettings_vocabularyFilterName :: (Maybe Text -> f (Maybe Text))
-> CallAnalyticsJobSettings -> f CallAnalyticsJobSettings
callAnalyticsJobSettings_vocabularyFilterName = (CallAnalyticsJobSettings -> Maybe Text)
-> (CallAnalyticsJobSettings
    -> Maybe Text -> CallAnalyticsJobSettings)
-> Lens
     CallAnalyticsJobSettings
     CallAnalyticsJobSettings
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CallAnalyticsJobSettings' {Maybe Text
vocabularyFilterName :: Maybe Text
$sel:vocabularyFilterName:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe Text
vocabularyFilterName} -> Maybe Text
vocabularyFilterName) (\s :: CallAnalyticsJobSettings
s@CallAnalyticsJobSettings' {} Maybe Text
a -> CallAnalyticsJobSettings
s {$sel:vocabularyFilterName:CallAnalyticsJobSettings' :: Maybe Text
vocabularyFilterName = Maybe Text
a} :: CallAnalyticsJobSettings)

-- | Set to mask to remove filtered text from the transcript and replace it
-- with three asterisks (\"***\") as placeholder text. Set to @remove@ to
-- remove filtered text from the transcript without using placeholder text.
-- Set to @tag@ to mark the word in the transcription output that matches
-- the vocabulary filter. When you set the filter method to @tag@, the
-- words matching your vocabulary filter are not masked or removed.
callAnalyticsJobSettings_vocabularyFilterMethod :: Lens.Lens' CallAnalyticsJobSettings (Prelude.Maybe VocabularyFilterMethod)
callAnalyticsJobSettings_vocabularyFilterMethod :: (Maybe VocabularyFilterMethod -> f (Maybe VocabularyFilterMethod))
-> CallAnalyticsJobSettings -> f CallAnalyticsJobSettings
callAnalyticsJobSettings_vocabularyFilterMethod = (CallAnalyticsJobSettings -> Maybe VocabularyFilterMethod)
-> (CallAnalyticsJobSettings
    -> Maybe VocabularyFilterMethod -> CallAnalyticsJobSettings)
-> Lens
     CallAnalyticsJobSettings
     CallAnalyticsJobSettings
     (Maybe VocabularyFilterMethod)
     (Maybe VocabularyFilterMethod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CallAnalyticsJobSettings' {Maybe VocabularyFilterMethod
vocabularyFilterMethod :: Maybe VocabularyFilterMethod
$sel:vocabularyFilterMethod:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe VocabularyFilterMethod
vocabularyFilterMethod} -> Maybe VocabularyFilterMethod
vocabularyFilterMethod) (\s :: CallAnalyticsJobSettings
s@CallAnalyticsJobSettings' {} Maybe VocabularyFilterMethod
a -> CallAnalyticsJobSettings
s {$sel:vocabularyFilterMethod:CallAnalyticsJobSettings' :: Maybe VocabularyFilterMethod
vocabularyFilterMethod = Maybe VocabularyFilterMethod
a} :: CallAnalyticsJobSettings)

instance Core.FromJSON CallAnalyticsJobSettings where
  parseJSON :: Value -> Parser CallAnalyticsJobSettings
parseJSON =
    String
-> (Object -> Parser CallAnalyticsJobSettings)
-> Value
-> Parser CallAnalyticsJobSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CallAnalyticsJobSettings"
      ( \Object
x ->
          Maybe ContentRedaction
-> Maybe (NonEmpty LanguageCode)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VocabularyFilterMethod
-> CallAnalyticsJobSettings
CallAnalyticsJobSettings'
            (Maybe ContentRedaction
 -> Maybe (NonEmpty LanguageCode)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe VocabularyFilterMethod
 -> CallAnalyticsJobSettings)
-> Parser (Maybe ContentRedaction)
-> Parser
     (Maybe (NonEmpty LanguageCode)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe VocabularyFilterMethod
      -> CallAnalyticsJobSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ContentRedaction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContentRedaction")
            Parser
  (Maybe (NonEmpty LanguageCode)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe VocabularyFilterMethod
   -> CallAnalyticsJobSettings)
-> Parser (Maybe (NonEmpty LanguageCode))
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe VocabularyFilterMethod
      -> CallAnalyticsJobSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty LanguageCode))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LanguageOptions")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe VocabularyFilterMethod
   -> CallAnalyticsJobSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe VocabularyFilterMethod
      -> CallAnalyticsJobSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VocabularyName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe VocabularyFilterMethod
   -> CallAnalyticsJobSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe VocabularyFilterMethod -> CallAnalyticsJobSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LanguageModelName")
            Parser
  (Maybe Text
   -> Maybe VocabularyFilterMethod -> CallAnalyticsJobSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe VocabularyFilterMethod -> CallAnalyticsJobSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VocabularyFilterName")
            Parser (Maybe VocabularyFilterMethod -> CallAnalyticsJobSettings)
-> Parser (Maybe VocabularyFilterMethod)
-> Parser CallAnalyticsJobSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VocabularyFilterMethod)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VocabularyFilterMethod")
      )

instance Prelude.Hashable CallAnalyticsJobSettings

instance Prelude.NFData CallAnalyticsJobSettings

instance Core.ToJSON CallAnalyticsJobSettings where
  toJSON :: CallAnalyticsJobSettings -> Value
toJSON CallAnalyticsJobSettings' {Maybe (NonEmpty LanguageCode)
Maybe Text
Maybe ContentRedaction
Maybe VocabularyFilterMethod
vocabularyFilterMethod :: Maybe VocabularyFilterMethod
vocabularyFilterName :: Maybe Text
languageModelName :: Maybe Text
vocabularyName :: Maybe Text
languageOptions :: Maybe (NonEmpty LanguageCode)
contentRedaction :: Maybe ContentRedaction
$sel:vocabularyFilterMethod:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe VocabularyFilterMethod
$sel:vocabularyFilterName:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe Text
$sel:languageModelName:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe Text
$sel:vocabularyName:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe Text
$sel:languageOptions:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe (NonEmpty LanguageCode)
$sel:contentRedaction:CallAnalyticsJobSettings' :: CallAnalyticsJobSettings -> Maybe ContentRedaction
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ContentRedaction" Text -> ContentRedaction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ContentRedaction -> Pair) -> Maybe ContentRedaction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContentRedaction
contentRedaction,
            (Text
"LanguageOptions" Text -> NonEmpty LanguageCode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty LanguageCode -> Pair)
-> Maybe (NonEmpty LanguageCode) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty LanguageCode)
languageOptions,
            (Text
"VocabularyName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vocabularyName,
            (Text
"LanguageModelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
languageModelName,
            (Text
"VocabularyFilterName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vocabularyFilterName,
            (Text
"VocabularyFilterMethod" Text -> VocabularyFilterMethod -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (VocabularyFilterMethod -> Pair)
-> Maybe VocabularyFilterMethod -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VocabularyFilterMethod
vocabularyFilterMethod
          ]
      )