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

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

-- | Provides optional settings for the @StartTranscriptionJob@ operation.
--
-- /See:/ 'newSettings' smart constructor.
data Settings = Settings'
  { -- | The name of a vocabulary to use when processing the transcription job.
    Settings -> Maybe Text
vocabularyName :: Prelude.Maybe Prelude.Text,
    -- | The number of alternative transcriptions that the service should return.
    -- If you specify the @MaxAlternatives@ field, you must set the
    -- @ShowAlternatives@ field to true.
    Settings -> Maybe Natural
maxAlternatives :: Prelude.Maybe Prelude.Natural,
    -- | Instructs Amazon Transcribe to process each audio channel separately and
    -- then merge the transcription output of each channel into a single
    -- transcription.
    --
    -- Amazon Transcribe also produces a transcription of each item detected on
    -- an audio channel, including the start time and end time of the item and
    -- alternative transcriptions of the item including the confidence that
    -- Amazon Transcribe has in the transcription.
    --
    -- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
    -- the same request. If you set both, your request returns a
    -- @BadRequestException@.
    Settings -> Maybe Bool
channelIdentification :: Prelude.Maybe Prelude.Bool,
    -- | Determines whether the transcription contains alternative
    -- transcriptions. If you set the @ShowAlternatives@ field to true, you
    -- must also set the maximum number of alternatives to return in the
    -- @MaxAlternatives@ field.
    Settings -> Maybe Bool
showAlternatives :: Prelude.Maybe Prelude.Bool,
    -- | The maximum number of speakers to identify in the input audio. If there
    -- are more speakers in the audio than this number, multiple speakers are
    -- identified as a single speaker. If you specify the @MaxSpeakerLabels@
    -- field, you must set the @ShowSpeakerLabels@ field to true.
    Settings -> Maybe Natural
maxSpeakerLabels :: Prelude.Maybe Prelude.Natural,
    -- | The name of the vocabulary filter to use when transcribing the audio.
    -- The filter that you specify must have the same language code as the
    -- transcription job.
    Settings -> Maybe Text
vocabularyFilterName :: Prelude.Maybe Prelude.Text,
    -- | Determines whether the transcription job uses speaker recognition to
    -- identify different speakers in the input audio. Speaker recognition
    -- labels individual speakers in the audio file. If you set the
    -- @ShowSpeakerLabels@ field to true, you must also set the maximum number
    -- of speaker labels @MaxSpeakerLabels@ field.
    --
    -- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
    -- the same request. If you set both, your request returns a
    -- @BadRequestException@.
    Settings -> Maybe Bool
showSpeakerLabels :: Prelude.Maybe Prelude.Bool,
    -- | 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.
    Settings -> Maybe VocabularyFilterMethod
vocabularyFilterMethod :: Prelude.Maybe VocabularyFilterMethod
  }
  deriving (Settings -> Settings -> Bool
(Settings -> Settings -> Bool)
-> (Settings -> Settings -> Bool) -> Eq Settings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Settings -> Settings -> Bool
$c/= :: Settings -> Settings -> Bool
== :: Settings -> Settings -> Bool
$c== :: Settings -> Settings -> Bool
Prelude.Eq, ReadPrec [Settings]
ReadPrec Settings
Int -> ReadS Settings
ReadS [Settings]
(Int -> ReadS Settings)
-> ReadS [Settings]
-> ReadPrec Settings
-> ReadPrec [Settings]
-> Read Settings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Settings]
$creadListPrec :: ReadPrec [Settings]
readPrec :: ReadPrec Settings
$creadPrec :: ReadPrec Settings
readList :: ReadS [Settings]
$creadList :: ReadS [Settings]
readsPrec :: Int -> ReadS Settings
$creadsPrec :: Int -> ReadS Settings
Prelude.Read, Int -> Settings -> ShowS
[Settings] -> ShowS
Settings -> String
(Int -> Settings -> ShowS)
-> (Settings -> String) -> ([Settings] -> ShowS) -> Show Settings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Settings] -> ShowS
$cshowList :: [Settings] -> ShowS
show :: Settings -> String
$cshow :: Settings -> String
showsPrec :: Int -> Settings -> ShowS
$cshowsPrec :: Int -> Settings -> ShowS
Prelude.Show, (forall x. Settings -> Rep Settings x)
-> (forall x. Rep Settings x -> Settings) -> Generic Settings
forall x. Rep Settings x -> Settings
forall x. Settings -> Rep Settings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Settings x -> Settings
$cfrom :: forall x. Settings -> Rep Settings x
Prelude.Generic)

-- |
-- Create a value of 'Settings' 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:
--
-- 'vocabularyName', 'settings_vocabularyName' - The name of a vocabulary to use when processing the transcription job.
--
-- 'maxAlternatives', 'settings_maxAlternatives' - The number of alternative transcriptions that the service should return.
-- If you specify the @MaxAlternatives@ field, you must set the
-- @ShowAlternatives@ field to true.
--
-- 'channelIdentification', 'settings_channelIdentification' - Instructs Amazon Transcribe to process each audio channel separately and
-- then merge the transcription output of each channel into a single
-- transcription.
--
-- Amazon Transcribe also produces a transcription of each item detected on
-- an audio channel, including the start time and end time of the item and
-- alternative transcriptions of the item including the confidence that
-- Amazon Transcribe has in the transcription.
--
-- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
-- the same request. If you set both, your request returns a
-- @BadRequestException@.
--
-- 'showAlternatives', 'settings_showAlternatives' - Determines whether the transcription contains alternative
-- transcriptions. If you set the @ShowAlternatives@ field to true, you
-- must also set the maximum number of alternatives to return in the
-- @MaxAlternatives@ field.
--
-- 'maxSpeakerLabels', 'settings_maxSpeakerLabels' - The maximum number of speakers to identify in the input audio. If there
-- are more speakers in the audio than this number, multiple speakers are
-- identified as a single speaker. If you specify the @MaxSpeakerLabels@
-- field, you must set the @ShowSpeakerLabels@ field to true.
--
-- 'vocabularyFilterName', 'settings_vocabularyFilterName' - The name of the vocabulary filter to use when transcribing the audio.
-- The filter that you specify must have the same language code as the
-- transcription job.
--
-- 'showSpeakerLabels', 'settings_showSpeakerLabels' - Determines whether the transcription job uses speaker recognition to
-- identify different speakers in the input audio. Speaker recognition
-- labels individual speakers in the audio file. If you set the
-- @ShowSpeakerLabels@ field to true, you must also set the maximum number
-- of speaker labels @MaxSpeakerLabels@ field.
--
-- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
-- the same request. If you set both, your request returns a
-- @BadRequestException@.
--
-- 'vocabularyFilterMethod', 'settings_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.
newSettings ::
  Settings
newSettings :: Settings
newSettings =
  Settings' :: Maybe Text
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> Maybe Natural
-> Maybe Text
-> Maybe Bool
-> Maybe VocabularyFilterMethod
-> Settings
Settings'
    { $sel:vocabularyName:Settings' :: Maybe Text
vocabularyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxAlternatives:Settings' :: Maybe Natural
maxAlternatives = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:channelIdentification:Settings' :: Maybe Bool
channelIdentification = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:showAlternatives:Settings' :: Maybe Bool
showAlternatives = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:maxSpeakerLabels:Settings' :: Maybe Natural
maxSpeakerLabels = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:vocabularyFilterName:Settings' :: Maybe Text
vocabularyFilterName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:showSpeakerLabels:Settings' :: Maybe Bool
showSpeakerLabels = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:vocabularyFilterMethod:Settings' :: Maybe VocabularyFilterMethod
vocabularyFilterMethod = Maybe VocabularyFilterMethod
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The number of alternative transcriptions that the service should return.
-- If you specify the @MaxAlternatives@ field, you must set the
-- @ShowAlternatives@ field to true.
settings_maxAlternatives :: Lens.Lens' Settings (Prelude.Maybe Prelude.Natural)
settings_maxAlternatives :: (Maybe Natural -> f (Maybe Natural)) -> Settings -> f Settings
settings_maxAlternatives = (Settings -> Maybe Natural)
-> (Settings -> Maybe Natural -> Settings)
-> Lens Settings Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Settings' {Maybe Natural
maxAlternatives :: Maybe Natural
$sel:maxAlternatives:Settings' :: Settings -> Maybe Natural
maxAlternatives} -> Maybe Natural
maxAlternatives) (\s :: Settings
s@Settings' {} Maybe Natural
a -> Settings
s {$sel:maxAlternatives:Settings' :: Maybe Natural
maxAlternatives = Maybe Natural
a} :: Settings)

-- | Instructs Amazon Transcribe to process each audio channel separately and
-- then merge the transcription output of each channel into a single
-- transcription.
--
-- Amazon Transcribe also produces a transcription of each item detected on
-- an audio channel, including the start time and end time of the item and
-- alternative transcriptions of the item including the confidence that
-- Amazon Transcribe has in the transcription.
--
-- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
-- the same request. If you set both, your request returns a
-- @BadRequestException@.
settings_channelIdentification :: Lens.Lens' Settings (Prelude.Maybe Prelude.Bool)
settings_channelIdentification :: (Maybe Bool -> f (Maybe Bool)) -> Settings -> f Settings
settings_channelIdentification = (Settings -> Maybe Bool)
-> (Settings -> Maybe Bool -> Settings)
-> Lens Settings Settings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Settings' {Maybe Bool
channelIdentification :: Maybe Bool
$sel:channelIdentification:Settings' :: Settings -> Maybe Bool
channelIdentification} -> Maybe Bool
channelIdentification) (\s :: Settings
s@Settings' {} Maybe Bool
a -> Settings
s {$sel:channelIdentification:Settings' :: Maybe Bool
channelIdentification = Maybe Bool
a} :: Settings)

-- | Determines whether the transcription contains alternative
-- transcriptions. If you set the @ShowAlternatives@ field to true, you
-- must also set the maximum number of alternatives to return in the
-- @MaxAlternatives@ field.
settings_showAlternatives :: Lens.Lens' Settings (Prelude.Maybe Prelude.Bool)
settings_showAlternatives :: (Maybe Bool -> f (Maybe Bool)) -> Settings -> f Settings
settings_showAlternatives = (Settings -> Maybe Bool)
-> (Settings -> Maybe Bool -> Settings)
-> Lens Settings Settings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Settings' {Maybe Bool
showAlternatives :: Maybe Bool
$sel:showAlternatives:Settings' :: Settings -> Maybe Bool
showAlternatives} -> Maybe Bool
showAlternatives) (\s :: Settings
s@Settings' {} Maybe Bool
a -> Settings
s {$sel:showAlternatives:Settings' :: Maybe Bool
showAlternatives = Maybe Bool
a} :: Settings)

-- | The maximum number of speakers to identify in the input audio. If there
-- are more speakers in the audio than this number, multiple speakers are
-- identified as a single speaker. If you specify the @MaxSpeakerLabels@
-- field, you must set the @ShowSpeakerLabels@ field to true.
settings_maxSpeakerLabels :: Lens.Lens' Settings (Prelude.Maybe Prelude.Natural)
settings_maxSpeakerLabels :: (Maybe Natural -> f (Maybe Natural)) -> Settings -> f Settings
settings_maxSpeakerLabels = (Settings -> Maybe Natural)
-> (Settings -> Maybe Natural -> Settings)
-> Lens Settings Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Settings' {Maybe Natural
maxSpeakerLabels :: Maybe Natural
$sel:maxSpeakerLabels:Settings' :: Settings -> Maybe Natural
maxSpeakerLabels} -> Maybe Natural
maxSpeakerLabels) (\s :: Settings
s@Settings' {} Maybe Natural
a -> Settings
s {$sel:maxSpeakerLabels:Settings' :: Maybe Natural
maxSpeakerLabels = Maybe Natural
a} :: Settings)

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

-- | Determines whether the transcription job uses speaker recognition to
-- identify different speakers in the input audio. Speaker recognition
-- labels individual speakers in the audio file. If you set the
-- @ShowSpeakerLabels@ field to true, you must also set the maximum number
-- of speaker labels @MaxSpeakerLabels@ field.
--
-- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
-- the same request. If you set both, your request returns a
-- @BadRequestException@.
settings_showSpeakerLabels :: Lens.Lens' Settings (Prelude.Maybe Prelude.Bool)
settings_showSpeakerLabels :: (Maybe Bool -> f (Maybe Bool)) -> Settings -> f Settings
settings_showSpeakerLabels = (Settings -> Maybe Bool)
-> (Settings -> Maybe Bool -> Settings)
-> Lens Settings Settings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Settings' {Maybe Bool
showSpeakerLabels :: Maybe Bool
$sel:showSpeakerLabels:Settings' :: Settings -> Maybe Bool
showSpeakerLabels} -> Maybe Bool
showSpeakerLabels) (\s :: Settings
s@Settings' {} Maybe Bool
a -> Settings
s {$sel:showSpeakerLabels:Settings' :: Maybe Bool
showSpeakerLabels = Maybe Bool
a} :: Settings)

-- | 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.
settings_vocabularyFilterMethod :: Lens.Lens' Settings (Prelude.Maybe VocabularyFilterMethod)
settings_vocabularyFilterMethod :: (Maybe VocabularyFilterMethod -> f (Maybe VocabularyFilterMethod))
-> Settings -> f Settings
settings_vocabularyFilterMethod = (Settings -> Maybe VocabularyFilterMethod)
-> (Settings -> Maybe VocabularyFilterMethod -> Settings)
-> Lens
     Settings
     Settings
     (Maybe VocabularyFilterMethod)
     (Maybe VocabularyFilterMethod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Settings' {Maybe VocabularyFilterMethod
vocabularyFilterMethod :: Maybe VocabularyFilterMethod
$sel:vocabularyFilterMethod:Settings' :: Settings -> Maybe VocabularyFilterMethod
vocabularyFilterMethod} -> Maybe VocabularyFilterMethod
vocabularyFilterMethod) (\s :: Settings
s@Settings' {} Maybe VocabularyFilterMethod
a -> Settings
s {$sel:vocabularyFilterMethod:Settings' :: Maybe VocabularyFilterMethod
vocabularyFilterMethod = Maybe VocabularyFilterMethod
a} :: Settings)

instance Core.FromJSON Settings where
  parseJSON :: Value -> Parser Settings
parseJSON =
    String -> (Object -> Parser Settings) -> Value -> Parser Settings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Settings"
      ( \Object
x ->
          Maybe Text
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> Maybe Natural
-> Maybe Text
-> Maybe Bool
-> Maybe VocabularyFilterMethod
-> Settings
Settings'
            (Maybe Text
 -> Maybe Natural
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Natural
 -> Maybe Text
 -> Maybe Bool
 -> Maybe VocabularyFilterMethod
 -> Settings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Bool
      -> Maybe VocabularyFilterMethod
      -> Settings)
forall (f :: * -> *) a b. Functor 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 Natural
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Bool
   -> Maybe VocabularyFilterMethod
   -> Settings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Bool
      -> Maybe VocabularyFilterMethod
      -> Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxAlternatives")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Bool
   -> Maybe VocabularyFilterMethod
   -> Settings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Bool
      -> Maybe VocabularyFilterMethod
      -> Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ChannelIdentification")
            Parser
  (Maybe Bool
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Bool
   -> Maybe VocabularyFilterMethod
   -> Settings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Natural
      -> Maybe Text
      -> Maybe Bool
      -> Maybe VocabularyFilterMethod
      -> Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ShowAlternatives")
            Parser
  (Maybe Natural
   -> Maybe Text
   -> Maybe Bool
   -> Maybe VocabularyFilterMethod
   -> Settings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Text
      -> Maybe Bool -> Maybe VocabularyFilterMethod -> Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxSpeakerLabels")
            Parser
  (Maybe Text
   -> Maybe Bool -> Maybe VocabularyFilterMethod -> Settings)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Maybe VocabularyFilterMethod -> Settings)
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 Bool -> Maybe VocabularyFilterMethod -> Settings)
-> Parser (Maybe Bool)
-> Parser (Maybe VocabularyFilterMethod -> Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ShowSpeakerLabels")
            Parser (Maybe VocabularyFilterMethod -> Settings)
-> Parser (Maybe VocabularyFilterMethod) -> Parser Settings
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 Settings

instance Prelude.NFData Settings

instance Core.ToJSON Settings where
  toJSON :: Settings -> Value
toJSON Settings' {Maybe Bool
Maybe Natural
Maybe Text
Maybe VocabularyFilterMethod
vocabularyFilterMethod :: Maybe VocabularyFilterMethod
showSpeakerLabels :: Maybe Bool
vocabularyFilterName :: Maybe Text
maxSpeakerLabels :: Maybe Natural
showAlternatives :: Maybe Bool
channelIdentification :: Maybe Bool
maxAlternatives :: Maybe Natural
vocabularyName :: Maybe Text
$sel:vocabularyFilterMethod:Settings' :: Settings -> Maybe VocabularyFilterMethod
$sel:showSpeakerLabels:Settings' :: Settings -> Maybe Bool
$sel:vocabularyFilterName:Settings' :: Settings -> Maybe Text
$sel:maxSpeakerLabels:Settings' :: Settings -> Maybe Natural
$sel:showAlternatives:Settings' :: Settings -> Maybe Bool
$sel:channelIdentification:Settings' :: Settings -> Maybe Bool
$sel:maxAlternatives:Settings' :: Settings -> Maybe Natural
$sel:vocabularyName:Settings' :: Settings -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"MaxAlternatives" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxAlternatives,
            (Text
"ChannelIdentification" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
channelIdentification,
            (Text
"ShowAlternatives" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
showAlternatives,
            (Text
"MaxSpeakerLabels" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxSpeakerLabels,
            (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
"ShowSpeakerLabels" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
showSpeakerLabels,
            (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
          ]
      )