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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Optional settings for the StartMedicalTranscriptionJob operation.
--
-- /See:/ 'newMedicalTranscriptionSetting' smart constructor.
data MedicalTranscriptionSetting = MedicalTranscriptionSetting'
  { -- | The name of the vocabulary to use when processing a medical
    -- transcription job.
    MedicalTranscriptionSetting -> Maybe Text
vocabularyName :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of alternatives that you tell the service to return.
    -- If you specify the @MaxAlternatives@ field, you must set the
    -- @ShowAlternatives@ field to true.
    MedicalTranscriptionSetting -> Maybe Natural
maxAlternatives :: Prelude.Maybe Prelude.Natural,
    -- | Instructs Amazon Transcribe Medical to process each audio channel
    -- separately and then merge the transcription output of each channel into
    -- a single transcription.
    --
    -- Amazon Transcribe Medical 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 item. The alternative
    -- transcriptions also come with confidence scores provided by Amazon
    -- Transcribe Medical.
    --
    -- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
    -- the same request. If you set both, your request returns a
    -- @BadRequestException@
    MedicalTranscriptionSetting -> Maybe Bool
channelIdentification :: Prelude.Maybe Prelude.Bool,
    -- | Determines whether alternative transcripts are generated along with the
    -- transcript that has the highest confidence. If you set
    -- @ShowAlternatives@ field to true, you must also set the maximum number
    -- of alternatives to return in the @MaxAlternatives@ field.
    MedicalTranscriptionSetting -> 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.
    MedicalTranscriptionSetting -> Maybe Natural
maxSpeakerLabels :: Prelude.Maybe Prelude.Natural,
    -- | 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 in the @MaxSpeakerLabels@ field.
    --
    -- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
    -- the same request. If you set both, your request returns a
    -- @BadRequestException@.
    MedicalTranscriptionSetting -> Maybe Bool
showSpeakerLabels :: Prelude.Maybe Prelude.Bool
  }
  deriving (MedicalTranscriptionSetting -> MedicalTranscriptionSetting -> Bool
(MedicalTranscriptionSetting
 -> MedicalTranscriptionSetting -> Bool)
-> (MedicalTranscriptionSetting
    -> MedicalTranscriptionSetting -> Bool)
-> Eq MedicalTranscriptionSetting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MedicalTranscriptionSetting -> MedicalTranscriptionSetting -> Bool
$c/= :: MedicalTranscriptionSetting -> MedicalTranscriptionSetting -> Bool
== :: MedicalTranscriptionSetting -> MedicalTranscriptionSetting -> Bool
$c== :: MedicalTranscriptionSetting -> MedicalTranscriptionSetting -> Bool
Prelude.Eq, ReadPrec [MedicalTranscriptionSetting]
ReadPrec MedicalTranscriptionSetting
Int -> ReadS MedicalTranscriptionSetting
ReadS [MedicalTranscriptionSetting]
(Int -> ReadS MedicalTranscriptionSetting)
-> ReadS [MedicalTranscriptionSetting]
-> ReadPrec MedicalTranscriptionSetting
-> ReadPrec [MedicalTranscriptionSetting]
-> Read MedicalTranscriptionSetting
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MedicalTranscriptionSetting]
$creadListPrec :: ReadPrec [MedicalTranscriptionSetting]
readPrec :: ReadPrec MedicalTranscriptionSetting
$creadPrec :: ReadPrec MedicalTranscriptionSetting
readList :: ReadS [MedicalTranscriptionSetting]
$creadList :: ReadS [MedicalTranscriptionSetting]
readsPrec :: Int -> ReadS MedicalTranscriptionSetting
$creadsPrec :: Int -> ReadS MedicalTranscriptionSetting
Prelude.Read, Int -> MedicalTranscriptionSetting -> ShowS
[MedicalTranscriptionSetting] -> ShowS
MedicalTranscriptionSetting -> String
(Int -> MedicalTranscriptionSetting -> ShowS)
-> (MedicalTranscriptionSetting -> String)
-> ([MedicalTranscriptionSetting] -> ShowS)
-> Show MedicalTranscriptionSetting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MedicalTranscriptionSetting] -> ShowS
$cshowList :: [MedicalTranscriptionSetting] -> ShowS
show :: MedicalTranscriptionSetting -> String
$cshow :: MedicalTranscriptionSetting -> String
showsPrec :: Int -> MedicalTranscriptionSetting -> ShowS
$cshowsPrec :: Int -> MedicalTranscriptionSetting -> ShowS
Prelude.Show, (forall x.
 MedicalTranscriptionSetting -> Rep MedicalTranscriptionSetting x)
-> (forall x.
    Rep MedicalTranscriptionSetting x -> MedicalTranscriptionSetting)
-> Generic MedicalTranscriptionSetting
forall x.
Rep MedicalTranscriptionSetting x -> MedicalTranscriptionSetting
forall x.
MedicalTranscriptionSetting -> Rep MedicalTranscriptionSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MedicalTranscriptionSetting x -> MedicalTranscriptionSetting
$cfrom :: forall x.
MedicalTranscriptionSetting -> Rep MedicalTranscriptionSetting x
Prelude.Generic)

-- |
-- Create a value of 'MedicalTranscriptionSetting' 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', 'medicalTranscriptionSetting_vocabularyName' - The name of the vocabulary to use when processing a medical
-- transcription job.
--
-- 'maxAlternatives', 'medicalTranscriptionSetting_maxAlternatives' - The maximum number of alternatives that you tell the service to return.
-- If you specify the @MaxAlternatives@ field, you must set the
-- @ShowAlternatives@ field to true.
--
-- 'channelIdentification', 'medicalTranscriptionSetting_channelIdentification' - Instructs Amazon Transcribe Medical to process each audio channel
-- separately and then merge the transcription output of each channel into
-- a single transcription.
--
-- Amazon Transcribe Medical 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 item. The alternative
-- transcriptions also come with confidence scores provided by Amazon
-- Transcribe Medical.
--
-- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
-- the same request. If you set both, your request returns a
-- @BadRequestException@
--
-- 'showAlternatives', 'medicalTranscriptionSetting_showAlternatives' - Determines whether alternative transcripts are generated along with the
-- transcript that has the highest confidence. If you set
-- @ShowAlternatives@ field to true, you must also set the maximum number
-- of alternatives to return in the @MaxAlternatives@ field.
--
-- 'maxSpeakerLabels', 'medicalTranscriptionSetting_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.
--
-- 'showSpeakerLabels', 'medicalTranscriptionSetting_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 in the @MaxSpeakerLabels@ field.
--
-- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
-- the same request. If you set both, your request returns a
-- @BadRequestException@.
newMedicalTranscriptionSetting ::
  MedicalTranscriptionSetting
newMedicalTranscriptionSetting :: MedicalTranscriptionSetting
newMedicalTranscriptionSetting =
  MedicalTranscriptionSetting' :: Maybe Text
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> Maybe Natural
-> Maybe Bool
-> MedicalTranscriptionSetting
MedicalTranscriptionSetting'
    { $sel:vocabularyName:MedicalTranscriptionSetting' :: Maybe Text
vocabularyName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxAlternatives:MedicalTranscriptionSetting' :: Maybe Natural
maxAlternatives = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:channelIdentification:MedicalTranscriptionSetting' :: Maybe Bool
channelIdentification = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:showAlternatives:MedicalTranscriptionSetting' :: Maybe Bool
showAlternatives = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:maxSpeakerLabels:MedicalTranscriptionSetting' :: Maybe Natural
maxSpeakerLabels = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:showSpeakerLabels:MedicalTranscriptionSetting' :: Maybe Bool
showSpeakerLabels = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | Instructs Amazon Transcribe Medical to process each audio channel
-- separately and then merge the transcription output of each channel into
-- a single transcription.
--
-- Amazon Transcribe Medical 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 item. The alternative
-- transcriptions also come with confidence scores provided by Amazon
-- Transcribe Medical.
--
-- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
-- the same request. If you set both, your request returns a
-- @BadRequestException@
medicalTranscriptionSetting_channelIdentification :: Lens.Lens' MedicalTranscriptionSetting (Prelude.Maybe Prelude.Bool)
medicalTranscriptionSetting_channelIdentification :: (Maybe Bool -> f (Maybe Bool))
-> MedicalTranscriptionSetting -> f MedicalTranscriptionSetting
medicalTranscriptionSetting_channelIdentification = (MedicalTranscriptionSetting -> Maybe Bool)
-> (MedicalTranscriptionSetting
    -> Maybe Bool -> MedicalTranscriptionSetting)
-> Lens
     MedicalTranscriptionSetting
     MedicalTranscriptionSetting
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MedicalTranscriptionSetting' {Maybe Bool
channelIdentification :: Maybe Bool
$sel:channelIdentification:MedicalTranscriptionSetting' :: MedicalTranscriptionSetting -> Maybe Bool
channelIdentification} -> Maybe Bool
channelIdentification) (\s :: MedicalTranscriptionSetting
s@MedicalTranscriptionSetting' {} Maybe Bool
a -> MedicalTranscriptionSetting
s {$sel:channelIdentification:MedicalTranscriptionSetting' :: Maybe Bool
channelIdentification = Maybe Bool
a} :: MedicalTranscriptionSetting)

-- | Determines whether alternative transcripts are generated along with the
-- transcript that has the highest confidence. If you set
-- @ShowAlternatives@ field to true, you must also set the maximum number
-- of alternatives to return in the @MaxAlternatives@ field.
medicalTranscriptionSetting_showAlternatives :: Lens.Lens' MedicalTranscriptionSetting (Prelude.Maybe Prelude.Bool)
medicalTranscriptionSetting_showAlternatives :: (Maybe Bool -> f (Maybe Bool))
-> MedicalTranscriptionSetting -> f MedicalTranscriptionSetting
medicalTranscriptionSetting_showAlternatives = (MedicalTranscriptionSetting -> Maybe Bool)
-> (MedicalTranscriptionSetting
    -> Maybe Bool -> MedicalTranscriptionSetting)
-> Lens
     MedicalTranscriptionSetting
     MedicalTranscriptionSetting
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MedicalTranscriptionSetting' {Maybe Bool
showAlternatives :: Maybe Bool
$sel:showAlternatives:MedicalTranscriptionSetting' :: MedicalTranscriptionSetting -> Maybe Bool
showAlternatives} -> Maybe Bool
showAlternatives) (\s :: MedicalTranscriptionSetting
s@MedicalTranscriptionSetting' {} Maybe Bool
a -> MedicalTranscriptionSetting
s {$sel:showAlternatives:MedicalTranscriptionSetting' :: Maybe Bool
showAlternatives = Maybe Bool
a} :: MedicalTranscriptionSetting)

-- | 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.
medicalTranscriptionSetting_maxSpeakerLabels :: Lens.Lens' MedicalTranscriptionSetting (Prelude.Maybe Prelude.Natural)
medicalTranscriptionSetting_maxSpeakerLabels :: (Maybe Natural -> f (Maybe Natural))
-> MedicalTranscriptionSetting -> f MedicalTranscriptionSetting
medicalTranscriptionSetting_maxSpeakerLabels = (MedicalTranscriptionSetting -> Maybe Natural)
-> (MedicalTranscriptionSetting
    -> Maybe Natural -> MedicalTranscriptionSetting)
-> Lens
     MedicalTranscriptionSetting
     MedicalTranscriptionSetting
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MedicalTranscriptionSetting' {Maybe Natural
maxSpeakerLabels :: Maybe Natural
$sel:maxSpeakerLabels:MedicalTranscriptionSetting' :: MedicalTranscriptionSetting -> Maybe Natural
maxSpeakerLabels} -> Maybe Natural
maxSpeakerLabels) (\s :: MedicalTranscriptionSetting
s@MedicalTranscriptionSetting' {} Maybe Natural
a -> MedicalTranscriptionSetting
s {$sel:maxSpeakerLabels:MedicalTranscriptionSetting' :: Maybe Natural
maxSpeakerLabels = Maybe Natural
a} :: MedicalTranscriptionSetting)

-- | 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 in the @MaxSpeakerLabels@ field.
--
-- You can\'t set both @ShowSpeakerLabels@ and @ChannelIdentification@ in
-- the same request. If you set both, your request returns a
-- @BadRequestException@.
medicalTranscriptionSetting_showSpeakerLabels :: Lens.Lens' MedicalTranscriptionSetting (Prelude.Maybe Prelude.Bool)
medicalTranscriptionSetting_showSpeakerLabels :: (Maybe Bool -> f (Maybe Bool))
-> MedicalTranscriptionSetting -> f MedicalTranscriptionSetting
medicalTranscriptionSetting_showSpeakerLabels = (MedicalTranscriptionSetting -> Maybe Bool)
-> (MedicalTranscriptionSetting
    -> Maybe Bool -> MedicalTranscriptionSetting)
-> Lens
     MedicalTranscriptionSetting
     MedicalTranscriptionSetting
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MedicalTranscriptionSetting' {Maybe Bool
showSpeakerLabels :: Maybe Bool
$sel:showSpeakerLabels:MedicalTranscriptionSetting' :: MedicalTranscriptionSetting -> Maybe Bool
showSpeakerLabels} -> Maybe Bool
showSpeakerLabels) (\s :: MedicalTranscriptionSetting
s@MedicalTranscriptionSetting' {} Maybe Bool
a -> MedicalTranscriptionSetting
s {$sel:showSpeakerLabels:MedicalTranscriptionSetting' :: Maybe Bool
showSpeakerLabels = Maybe Bool
a} :: MedicalTranscriptionSetting)

instance Core.FromJSON MedicalTranscriptionSetting where
  parseJSON :: Value -> Parser MedicalTranscriptionSetting
parseJSON =
    String
-> (Object -> Parser MedicalTranscriptionSetting)
-> Value
-> Parser MedicalTranscriptionSetting
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MedicalTranscriptionSetting"
      ( \Object
x ->
          Maybe Text
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> Maybe Natural
-> Maybe Bool
-> MedicalTranscriptionSetting
MedicalTranscriptionSetting'
            (Maybe Text
 -> Maybe Natural
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Natural
 -> Maybe Bool
 -> MedicalTranscriptionSetting)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Natural
      -> Maybe Bool
      -> MedicalTranscriptionSetting)
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 Bool
   -> MedicalTranscriptionSetting)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Natural
      -> Maybe Bool
      -> MedicalTranscriptionSetting)
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 Bool
   -> MedicalTranscriptionSetting)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Natural -> Maybe Bool -> MedicalTranscriptionSetting)
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 Bool -> MedicalTranscriptionSetting)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Natural -> Maybe Bool -> MedicalTranscriptionSetting)
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 Bool -> MedicalTranscriptionSetting)
-> Parser (Maybe Natural)
-> Parser (Maybe Bool -> MedicalTranscriptionSetting)
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 Bool -> MedicalTranscriptionSetting)
-> Parser (Maybe Bool) -> Parser MedicalTranscriptionSetting
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")
      )

instance Prelude.Hashable MedicalTranscriptionSetting

instance Prelude.NFData MedicalTranscriptionSetting

instance Core.ToJSON MedicalTranscriptionSetting where
  toJSON :: MedicalTranscriptionSetting -> Value
toJSON MedicalTranscriptionSetting' {Maybe Bool
Maybe Natural
Maybe Text
showSpeakerLabels :: Maybe Bool
maxSpeakerLabels :: Maybe Natural
showAlternatives :: Maybe Bool
channelIdentification :: Maybe Bool
maxAlternatives :: Maybe Natural
vocabularyName :: Maybe Text
$sel:showSpeakerLabels:MedicalTranscriptionSetting' :: MedicalTranscriptionSetting -> Maybe Bool
$sel:maxSpeakerLabels:MedicalTranscriptionSetting' :: MedicalTranscriptionSetting -> Maybe Natural
$sel:showAlternatives:MedicalTranscriptionSetting' :: MedicalTranscriptionSetting -> Maybe Bool
$sel:channelIdentification:MedicalTranscriptionSetting' :: MedicalTranscriptionSetting -> Maybe Bool
$sel:maxAlternatives:MedicalTranscriptionSetting' :: MedicalTranscriptionSetting -> Maybe Natural
$sel:vocabularyName:MedicalTranscriptionSetting' :: MedicalTranscriptionSetting -> 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
"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
          ]
      )