{-# 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.ModelSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ModelSettings = ModelSettings'
{
ModelSettings -> Maybe Text
languageModelName :: Prelude.Maybe Prelude.Text
}
deriving (ModelSettings -> ModelSettings -> Bool
(ModelSettings -> ModelSettings -> Bool)
-> (ModelSettings -> ModelSettings -> Bool) -> Eq ModelSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelSettings -> ModelSettings -> Bool
$c/= :: ModelSettings -> ModelSettings -> Bool
== :: ModelSettings -> ModelSettings -> Bool
$c== :: ModelSettings -> ModelSettings -> Bool
Prelude.Eq, ReadPrec [ModelSettings]
ReadPrec ModelSettings
Int -> ReadS ModelSettings
ReadS [ModelSettings]
(Int -> ReadS ModelSettings)
-> ReadS [ModelSettings]
-> ReadPrec ModelSettings
-> ReadPrec [ModelSettings]
-> Read ModelSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelSettings]
$creadListPrec :: ReadPrec [ModelSettings]
readPrec :: ReadPrec ModelSettings
$creadPrec :: ReadPrec ModelSettings
readList :: ReadS [ModelSettings]
$creadList :: ReadS [ModelSettings]
readsPrec :: Int -> ReadS ModelSettings
$creadsPrec :: Int -> ReadS ModelSettings
Prelude.Read, Int -> ModelSettings -> ShowS
[ModelSettings] -> ShowS
ModelSettings -> String
(Int -> ModelSettings -> ShowS)
-> (ModelSettings -> String)
-> ([ModelSettings] -> ShowS)
-> Show ModelSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelSettings] -> ShowS
$cshowList :: [ModelSettings] -> ShowS
show :: ModelSettings -> String
$cshow :: ModelSettings -> String
showsPrec :: Int -> ModelSettings -> ShowS
$cshowsPrec :: Int -> ModelSettings -> ShowS
Prelude.Show, (forall x. ModelSettings -> Rep ModelSettings x)
-> (forall x. Rep ModelSettings x -> ModelSettings)
-> Generic ModelSettings
forall x. Rep ModelSettings x -> ModelSettings
forall x. ModelSettings -> Rep ModelSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModelSettings x -> ModelSettings
$cfrom :: forall x. ModelSettings -> Rep ModelSettings x
Prelude.Generic)
newModelSettings ::
ModelSettings
newModelSettings :: ModelSettings
newModelSettings =
ModelSettings' :: Maybe Text -> ModelSettings
ModelSettings' {$sel:languageModelName:ModelSettings' :: Maybe Text
languageModelName = Maybe Text
forall a. Maybe a
Prelude.Nothing}
modelSettings_languageModelName :: Lens.Lens' ModelSettings (Prelude.Maybe Prelude.Text)
modelSettings_languageModelName :: (Maybe Text -> f (Maybe Text)) -> ModelSettings -> f ModelSettings
modelSettings_languageModelName = (ModelSettings -> Maybe Text)
-> (ModelSettings -> Maybe Text -> ModelSettings)
-> Lens ModelSettings ModelSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelSettings' {Maybe Text
languageModelName :: Maybe Text
$sel:languageModelName:ModelSettings' :: ModelSettings -> Maybe Text
languageModelName} -> Maybe Text
languageModelName) (\s :: ModelSettings
s@ModelSettings' {} Maybe Text
a -> ModelSettings
s {$sel:languageModelName:ModelSettings' :: Maybe Text
languageModelName = Maybe Text
a} :: ModelSettings)
instance Core.FromJSON ModelSettings where
parseJSON :: Value -> Parser ModelSettings
parseJSON =
String
-> (Object -> Parser ModelSettings)
-> Value
-> Parser ModelSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ModelSettings"
( \Object
x ->
Maybe Text -> ModelSettings
ModelSettings'
(Maybe Text -> ModelSettings)
-> Parser (Maybe Text) -> Parser ModelSettings
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
"LanguageModelName")
)
instance Prelude.Hashable ModelSettings
instance Prelude.NFData ModelSettings
instance Core.ToJSON ModelSettings where
toJSON :: ModelSettings -> Value
toJSON ModelSettings' {Maybe Text
languageModelName :: Maybe Text
$sel:languageModelName:ModelSettings' :: ModelSettings -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
]
)