{-# 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 #-}
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
data Settings = Settings'
{
Settings -> Maybe Text
vocabularyName :: Prelude.Maybe Prelude.Text,
Settings -> Maybe Natural
maxAlternatives :: Prelude.Maybe Prelude.Natural,
Settings -> Maybe Bool
channelIdentification :: Prelude.Maybe Prelude.Bool,
Settings -> Maybe Bool
showAlternatives :: Prelude.Maybe Prelude.Bool,
Settings -> Maybe Natural
maxSpeakerLabels :: Prelude.Maybe Prelude.Natural,
Settings -> Maybe Text
vocabularyFilterName :: Prelude.Maybe Prelude.Text,
Settings -> Maybe Bool
showSpeakerLabels :: Prelude.Maybe Prelude.Bool,
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)
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
}
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)
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)
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)
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)
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)
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)
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)
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
]
)