{-# 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.Polly.Types.SynthesisTask
-- 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.Polly.Types.SynthesisTask where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Polly.Types.Engine
import Amazonka.Polly.Types.LanguageCode
import Amazonka.Polly.Types.OutputFormat
import Amazonka.Polly.Types.SpeechMarkType
import Amazonka.Polly.Types.TaskStatus
import Amazonka.Polly.Types.TextType
import Amazonka.Polly.Types.VoiceId
import qualified Amazonka.Prelude as Prelude

-- | SynthesisTask object that provides information about a speech synthesis
-- task.
--
-- /See:/ 'newSynthesisTask' smart constructor.
data SynthesisTask = SynthesisTask'
  { -- | Timestamp for the time the synthesis task was started.
    SynthesisTask -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | Optional language code for a synthesis task. This is only necessary if
    -- using a bilingual voice, such as Aditi, which can be used for either
    -- Indian English (en-IN) or Hindi (hi-IN).
    --
    -- If a bilingual voice is used and no language code is specified, Amazon
    -- Polly uses the default language of the bilingual voice. The default
    -- language for any voice is the one returned by the
    -- <https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html DescribeVoices>
    -- operation for the @LanguageCode@ parameter. For example, if no language
    -- code is specified, Aditi will use Indian English rather than Hindi.
    SynthesisTask -> Maybe LanguageCode
languageCode :: Prelude.Maybe LanguageCode,
    -- | ARN for the SNS topic optionally used for providing status notification
    -- for a speech synthesis task.
    SynthesisTask -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
    -- | Reason for the current status of a specific speech synthesis task,
    -- including errors if the task has failed.
    SynthesisTask -> Maybe Text
taskStatusReason :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Polly generated identifier for a speech synthesis task.
    SynthesisTask -> Maybe Text
taskId :: Prelude.Maybe Prelude.Text,
    -- | Number of billable characters synthesized.
    SynthesisTask -> Maybe Int
requestCharacters :: Prelude.Maybe Prelude.Int,
    -- | Specifies the engine (@standard@ or @neural@) for Amazon Polly to use
    -- when processing input text for speech synthesis. Using a voice that is
    -- not supported for the engine selected will result in an error.
    SynthesisTask -> Maybe Engine
engine :: Prelude.Maybe Engine,
    -- | The type of speech marks returned for the input text.
    SynthesisTask -> Maybe [SpeechMarkType]
speechMarkTypes :: Prelude.Maybe [SpeechMarkType],
    -- | The audio frequency specified in Hz.
    --
    -- The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\",
    -- \"22050\", and \"24000\". The default value for standard voices is
    -- \"22050\". The default value for neural voices is \"24000\".
    --
    -- Valid values for pcm are \"8000\" and \"16000\" The default value is
    -- \"16000\".
    SynthesisTask -> Maybe Text
sampleRate :: Prelude.Maybe Prelude.Text,
    -- | The format in which the returned output will be encoded. For audio
    -- stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this
    -- will be json.
    SynthesisTask -> Maybe OutputFormat
outputFormat :: Prelude.Maybe OutputFormat,
    -- | Specifies whether the input text is plain text or SSML. The default
    -- value is plain text.
    SynthesisTask -> Maybe TextType
textType :: Prelude.Maybe TextType,
    -- | Voice ID to use for the synthesis.
    SynthesisTask -> Maybe VoiceId
voiceId :: Prelude.Maybe VoiceId,
    -- | List of one or more pronunciation lexicon names you want the service to
    -- apply during synthesis. Lexicons are applied only if the language of the
    -- lexicon is the same as the language of the voice.
    SynthesisTask -> Maybe [Text]
lexiconNames :: Prelude.Maybe [Prelude.Text],
    -- | Current status of the individual speech synthesis task.
    SynthesisTask -> Maybe TaskStatus
taskStatus :: Prelude.Maybe TaskStatus,
    -- | Pathway for the output speech file.
    SynthesisTask -> Maybe Text
outputUri :: Prelude.Maybe Prelude.Text
  }
  deriving (SynthesisTask -> SynthesisTask -> Bool
(SynthesisTask -> SynthesisTask -> Bool)
-> (SynthesisTask -> SynthesisTask -> Bool) -> Eq SynthesisTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SynthesisTask -> SynthesisTask -> Bool
$c/= :: SynthesisTask -> SynthesisTask -> Bool
== :: SynthesisTask -> SynthesisTask -> Bool
$c== :: SynthesisTask -> SynthesisTask -> Bool
Prelude.Eq, ReadPrec [SynthesisTask]
ReadPrec SynthesisTask
Int -> ReadS SynthesisTask
ReadS [SynthesisTask]
(Int -> ReadS SynthesisTask)
-> ReadS [SynthesisTask]
-> ReadPrec SynthesisTask
-> ReadPrec [SynthesisTask]
-> Read SynthesisTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SynthesisTask]
$creadListPrec :: ReadPrec [SynthesisTask]
readPrec :: ReadPrec SynthesisTask
$creadPrec :: ReadPrec SynthesisTask
readList :: ReadS [SynthesisTask]
$creadList :: ReadS [SynthesisTask]
readsPrec :: Int -> ReadS SynthesisTask
$creadsPrec :: Int -> ReadS SynthesisTask
Prelude.Read, Int -> SynthesisTask -> ShowS
[SynthesisTask] -> ShowS
SynthesisTask -> String
(Int -> SynthesisTask -> ShowS)
-> (SynthesisTask -> String)
-> ([SynthesisTask] -> ShowS)
-> Show SynthesisTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SynthesisTask] -> ShowS
$cshowList :: [SynthesisTask] -> ShowS
show :: SynthesisTask -> String
$cshow :: SynthesisTask -> String
showsPrec :: Int -> SynthesisTask -> ShowS
$cshowsPrec :: Int -> SynthesisTask -> ShowS
Prelude.Show, (forall x. SynthesisTask -> Rep SynthesisTask x)
-> (forall x. Rep SynthesisTask x -> SynthesisTask)
-> Generic SynthesisTask
forall x. Rep SynthesisTask x -> SynthesisTask
forall x. SynthesisTask -> Rep SynthesisTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SynthesisTask x -> SynthesisTask
$cfrom :: forall x. SynthesisTask -> Rep SynthesisTask x
Prelude.Generic)

-- |
-- Create a value of 'SynthesisTask' 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:
--
-- 'creationTime', 'synthesisTask_creationTime' - Timestamp for the time the synthesis task was started.
--
-- 'languageCode', 'synthesisTask_languageCode' - Optional language code for a synthesis task. This is only necessary if
-- using a bilingual voice, such as Aditi, which can be used for either
-- Indian English (en-IN) or Hindi (hi-IN).
--
-- If a bilingual voice is used and no language code is specified, Amazon
-- Polly uses the default language of the bilingual voice. The default
-- language for any voice is the one returned by the
-- <https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html DescribeVoices>
-- operation for the @LanguageCode@ parameter. For example, if no language
-- code is specified, Aditi will use Indian English rather than Hindi.
--
-- 'snsTopicArn', 'synthesisTask_snsTopicArn' - ARN for the SNS topic optionally used for providing status notification
-- for a speech synthesis task.
--
-- 'taskStatusReason', 'synthesisTask_taskStatusReason' - Reason for the current status of a specific speech synthesis task,
-- including errors if the task has failed.
--
-- 'taskId', 'synthesisTask_taskId' - The Amazon Polly generated identifier for a speech synthesis task.
--
-- 'requestCharacters', 'synthesisTask_requestCharacters' - Number of billable characters synthesized.
--
-- 'engine', 'synthesisTask_engine' - Specifies the engine (@standard@ or @neural@) for Amazon Polly to use
-- when processing input text for speech synthesis. Using a voice that is
-- not supported for the engine selected will result in an error.
--
-- 'speechMarkTypes', 'synthesisTask_speechMarkTypes' - The type of speech marks returned for the input text.
--
-- 'sampleRate', 'synthesisTask_sampleRate' - The audio frequency specified in Hz.
--
-- The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\",
-- \"22050\", and \"24000\". The default value for standard voices is
-- \"22050\". The default value for neural voices is \"24000\".
--
-- Valid values for pcm are \"8000\" and \"16000\" The default value is
-- \"16000\".
--
-- 'outputFormat', 'synthesisTask_outputFormat' - The format in which the returned output will be encoded. For audio
-- stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this
-- will be json.
--
-- 'textType', 'synthesisTask_textType' - Specifies whether the input text is plain text or SSML. The default
-- value is plain text.
--
-- 'voiceId', 'synthesisTask_voiceId' - Voice ID to use for the synthesis.
--
-- 'lexiconNames', 'synthesisTask_lexiconNames' - List of one or more pronunciation lexicon names you want the service to
-- apply during synthesis. Lexicons are applied only if the language of the
-- lexicon is the same as the language of the voice.
--
-- 'taskStatus', 'synthesisTask_taskStatus' - Current status of the individual speech synthesis task.
--
-- 'outputUri', 'synthesisTask_outputUri' - Pathway for the output speech file.
newSynthesisTask ::
  SynthesisTask
newSynthesisTask :: SynthesisTask
newSynthesisTask =
  SynthesisTask' :: Maybe POSIX
-> Maybe LanguageCode
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Engine
-> Maybe [SpeechMarkType]
-> Maybe Text
-> Maybe OutputFormat
-> Maybe TextType
-> Maybe VoiceId
-> Maybe [Text]
-> Maybe TaskStatus
-> Maybe Text
-> SynthesisTask
SynthesisTask'
    { $sel:creationTime:SynthesisTask' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:languageCode:SynthesisTask' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
forall a. Maybe a
Prelude.Nothing,
      $sel:snsTopicArn:SynthesisTask' :: Maybe Text
snsTopicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskStatusReason:SynthesisTask' :: Maybe Text
taskStatusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskId:SynthesisTask' :: Maybe Text
taskId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requestCharacters:SynthesisTask' :: Maybe Int
requestCharacters = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:engine:SynthesisTask' :: Maybe Engine
engine = Maybe Engine
forall a. Maybe a
Prelude.Nothing,
      $sel:speechMarkTypes:SynthesisTask' :: Maybe [SpeechMarkType]
speechMarkTypes = Maybe [SpeechMarkType]
forall a. Maybe a
Prelude.Nothing,
      $sel:sampleRate:SynthesisTask' :: Maybe Text
sampleRate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:outputFormat:SynthesisTask' :: Maybe OutputFormat
outputFormat = Maybe OutputFormat
forall a. Maybe a
Prelude.Nothing,
      $sel:textType:SynthesisTask' :: Maybe TextType
textType = Maybe TextType
forall a. Maybe a
Prelude.Nothing,
      $sel:voiceId:SynthesisTask' :: Maybe VoiceId
voiceId = Maybe VoiceId
forall a. Maybe a
Prelude.Nothing,
      $sel:lexiconNames:SynthesisTask' :: Maybe [Text]
lexiconNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:taskStatus:SynthesisTask' :: Maybe TaskStatus
taskStatus = Maybe TaskStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:outputUri:SynthesisTask' :: Maybe Text
outputUri = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Timestamp for the time the synthesis task was started.
synthesisTask_creationTime :: Lens.Lens' SynthesisTask (Prelude.Maybe Prelude.UTCTime)
synthesisTask_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SynthesisTask -> f SynthesisTask
synthesisTask_creationTime = (SynthesisTask -> Maybe POSIX)
-> (SynthesisTask -> Maybe POSIX -> SynthesisTask)
-> Lens SynthesisTask SynthesisTask (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:SynthesisTask' :: SynthesisTask -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe POSIX
a -> SynthesisTask
s {$sel:creationTime:SynthesisTask' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: SynthesisTask) ((Maybe POSIX -> f (Maybe POSIX))
 -> SynthesisTask -> f SynthesisTask)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SynthesisTask
-> f SynthesisTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Optional language code for a synthesis task. This is only necessary if
-- using a bilingual voice, such as Aditi, which can be used for either
-- Indian English (en-IN) or Hindi (hi-IN).
--
-- If a bilingual voice is used and no language code is specified, Amazon
-- Polly uses the default language of the bilingual voice. The default
-- language for any voice is the one returned by the
-- <https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html DescribeVoices>
-- operation for the @LanguageCode@ parameter. For example, if no language
-- code is specified, Aditi will use Indian English rather than Hindi.
synthesisTask_languageCode :: Lens.Lens' SynthesisTask (Prelude.Maybe LanguageCode)
synthesisTask_languageCode :: (Maybe LanguageCode -> f (Maybe LanguageCode))
-> SynthesisTask -> f SynthesisTask
synthesisTask_languageCode = (SynthesisTask -> Maybe LanguageCode)
-> (SynthesisTask -> Maybe LanguageCode -> SynthesisTask)
-> Lens
     SynthesisTask
     SynthesisTask
     (Maybe LanguageCode)
     (Maybe LanguageCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe LanguageCode
languageCode :: Maybe LanguageCode
$sel:languageCode:SynthesisTask' :: SynthesisTask -> Maybe LanguageCode
languageCode} -> Maybe LanguageCode
languageCode) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe LanguageCode
a -> SynthesisTask
s {$sel:languageCode:SynthesisTask' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
a} :: SynthesisTask)

-- | ARN for the SNS topic optionally used for providing status notification
-- for a speech synthesis task.
synthesisTask_snsTopicArn :: Lens.Lens' SynthesisTask (Prelude.Maybe Prelude.Text)
synthesisTask_snsTopicArn :: (Maybe Text -> f (Maybe Text)) -> SynthesisTask -> f SynthesisTask
synthesisTask_snsTopicArn = (SynthesisTask -> Maybe Text)
-> (SynthesisTask -> Maybe Text -> SynthesisTask)
-> Lens SynthesisTask SynthesisTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe Text
snsTopicArn :: Maybe Text
$sel:snsTopicArn:SynthesisTask' :: SynthesisTask -> Maybe Text
snsTopicArn} -> Maybe Text
snsTopicArn) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe Text
a -> SynthesisTask
s {$sel:snsTopicArn:SynthesisTask' :: Maybe Text
snsTopicArn = Maybe Text
a} :: SynthesisTask)

-- | Reason for the current status of a specific speech synthesis task,
-- including errors if the task has failed.
synthesisTask_taskStatusReason :: Lens.Lens' SynthesisTask (Prelude.Maybe Prelude.Text)
synthesisTask_taskStatusReason :: (Maybe Text -> f (Maybe Text)) -> SynthesisTask -> f SynthesisTask
synthesisTask_taskStatusReason = (SynthesisTask -> Maybe Text)
-> (SynthesisTask -> Maybe Text -> SynthesisTask)
-> Lens SynthesisTask SynthesisTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe Text
taskStatusReason :: Maybe Text
$sel:taskStatusReason:SynthesisTask' :: SynthesisTask -> Maybe Text
taskStatusReason} -> Maybe Text
taskStatusReason) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe Text
a -> SynthesisTask
s {$sel:taskStatusReason:SynthesisTask' :: Maybe Text
taskStatusReason = Maybe Text
a} :: SynthesisTask)

-- | The Amazon Polly generated identifier for a speech synthesis task.
synthesisTask_taskId :: Lens.Lens' SynthesisTask (Prelude.Maybe Prelude.Text)
synthesisTask_taskId :: (Maybe Text -> f (Maybe Text)) -> SynthesisTask -> f SynthesisTask
synthesisTask_taskId = (SynthesisTask -> Maybe Text)
-> (SynthesisTask -> Maybe Text -> SynthesisTask)
-> Lens SynthesisTask SynthesisTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe Text
taskId :: Maybe Text
$sel:taskId:SynthesisTask' :: SynthesisTask -> Maybe Text
taskId} -> Maybe Text
taskId) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe Text
a -> SynthesisTask
s {$sel:taskId:SynthesisTask' :: Maybe Text
taskId = Maybe Text
a} :: SynthesisTask)

-- | Number of billable characters synthesized.
synthesisTask_requestCharacters :: Lens.Lens' SynthesisTask (Prelude.Maybe Prelude.Int)
synthesisTask_requestCharacters :: (Maybe Int -> f (Maybe Int)) -> SynthesisTask -> f SynthesisTask
synthesisTask_requestCharacters = (SynthesisTask -> Maybe Int)
-> (SynthesisTask -> Maybe Int -> SynthesisTask)
-> Lens SynthesisTask SynthesisTask (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe Int
requestCharacters :: Maybe Int
$sel:requestCharacters:SynthesisTask' :: SynthesisTask -> Maybe Int
requestCharacters} -> Maybe Int
requestCharacters) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe Int
a -> SynthesisTask
s {$sel:requestCharacters:SynthesisTask' :: Maybe Int
requestCharacters = Maybe Int
a} :: SynthesisTask)

-- | Specifies the engine (@standard@ or @neural@) for Amazon Polly to use
-- when processing input text for speech synthesis. Using a voice that is
-- not supported for the engine selected will result in an error.
synthesisTask_engine :: Lens.Lens' SynthesisTask (Prelude.Maybe Engine)
synthesisTask_engine :: (Maybe Engine -> f (Maybe Engine))
-> SynthesisTask -> f SynthesisTask
synthesisTask_engine = (SynthesisTask -> Maybe Engine)
-> (SynthesisTask -> Maybe Engine -> SynthesisTask)
-> Lens SynthesisTask SynthesisTask (Maybe Engine) (Maybe Engine)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe Engine
engine :: Maybe Engine
$sel:engine:SynthesisTask' :: SynthesisTask -> Maybe Engine
engine} -> Maybe Engine
engine) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe Engine
a -> SynthesisTask
s {$sel:engine:SynthesisTask' :: Maybe Engine
engine = Maybe Engine
a} :: SynthesisTask)

-- | The type of speech marks returned for the input text.
synthesisTask_speechMarkTypes :: Lens.Lens' SynthesisTask (Prelude.Maybe [SpeechMarkType])
synthesisTask_speechMarkTypes :: (Maybe [SpeechMarkType] -> f (Maybe [SpeechMarkType]))
-> SynthesisTask -> f SynthesisTask
synthesisTask_speechMarkTypes = (SynthesisTask -> Maybe [SpeechMarkType])
-> (SynthesisTask -> Maybe [SpeechMarkType] -> SynthesisTask)
-> Lens
     SynthesisTask
     SynthesisTask
     (Maybe [SpeechMarkType])
     (Maybe [SpeechMarkType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe [SpeechMarkType]
speechMarkTypes :: Maybe [SpeechMarkType]
$sel:speechMarkTypes:SynthesisTask' :: SynthesisTask -> Maybe [SpeechMarkType]
speechMarkTypes} -> Maybe [SpeechMarkType]
speechMarkTypes) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe [SpeechMarkType]
a -> SynthesisTask
s {$sel:speechMarkTypes:SynthesisTask' :: Maybe [SpeechMarkType]
speechMarkTypes = Maybe [SpeechMarkType]
a} :: SynthesisTask) ((Maybe [SpeechMarkType] -> f (Maybe [SpeechMarkType]))
 -> SynthesisTask -> f SynthesisTask)
-> ((Maybe [SpeechMarkType] -> f (Maybe [SpeechMarkType]))
    -> Maybe [SpeechMarkType] -> f (Maybe [SpeechMarkType]))
-> (Maybe [SpeechMarkType] -> f (Maybe [SpeechMarkType]))
-> SynthesisTask
-> f SynthesisTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SpeechMarkType] [SpeechMarkType] [SpeechMarkType] [SpeechMarkType]
-> Iso
     (Maybe [SpeechMarkType])
     (Maybe [SpeechMarkType])
     (Maybe [SpeechMarkType])
     (Maybe [SpeechMarkType])
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
  [SpeechMarkType] [SpeechMarkType] [SpeechMarkType] [SpeechMarkType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The audio frequency specified in Hz.
--
-- The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\",
-- \"22050\", and \"24000\". The default value for standard voices is
-- \"22050\". The default value for neural voices is \"24000\".
--
-- Valid values for pcm are \"8000\" and \"16000\" The default value is
-- \"16000\".
synthesisTask_sampleRate :: Lens.Lens' SynthesisTask (Prelude.Maybe Prelude.Text)
synthesisTask_sampleRate :: (Maybe Text -> f (Maybe Text)) -> SynthesisTask -> f SynthesisTask
synthesisTask_sampleRate = (SynthesisTask -> Maybe Text)
-> (SynthesisTask -> Maybe Text -> SynthesisTask)
-> Lens SynthesisTask SynthesisTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe Text
sampleRate :: Maybe Text
$sel:sampleRate:SynthesisTask' :: SynthesisTask -> Maybe Text
sampleRate} -> Maybe Text
sampleRate) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe Text
a -> SynthesisTask
s {$sel:sampleRate:SynthesisTask' :: Maybe Text
sampleRate = Maybe Text
a} :: SynthesisTask)

-- | The format in which the returned output will be encoded. For audio
-- stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this
-- will be json.
synthesisTask_outputFormat :: Lens.Lens' SynthesisTask (Prelude.Maybe OutputFormat)
synthesisTask_outputFormat :: (Maybe OutputFormat -> f (Maybe OutputFormat))
-> SynthesisTask -> f SynthesisTask
synthesisTask_outputFormat = (SynthesisTask -> Maybe OutputFormat)
-> (SynthesisTask -> Maybe OutputFormat -> SynthesisTask)
-> Lens
     SynthesisTask
     SynthesisTask
     (Maybe OutputFormat)
     (Maybe OutputFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe OutputFormat
outputFormat :: Maybe OutputFormat
$sel:outputFormat:SynthesisTask' :: SynthesisTask -> Maybe OutputFormat
outputFormat} -> Maybe OutputFormat
outputFormat) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe OutputFormat
a -> SynthesisTask
s {$sel:outputFormat:SynthesisTask' :: Maybe OutputFormat
outputFormat = Maybe OutputFormat
a} :: SynthesisTask)

-- | Specifies whether the input text is plain text or SSML. The default
-- value is plain text.
synthesisTask_textType :: Lens.Lens' SynthesisTask (Prelude.Maybe TextType)
synthesisTask_textType :: (Maybe TextType -> f (Maybe TextType))
-> SynthesisTask -> f SynthesisTask
synthesisTask_textType = (SynthesisTask -> Maybe TextType)
-> (SynthesisTask -> Maybe TextType -> SynthesisTask)
-> Lens
     SynthesisTask SynthesisTask (Maybe TextType) (Maybe TextType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe TextType
textType :: Maybe TextType
$sel:textType:SynthesisTask' :: SynthesisTask -> Maybe TextType
textType} -> Maybe TextType
textType) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe TextType
a -> SynthesisTask
s {$sel:textType:SynthesisTask' :: Maybe TextType
textType = Maybe TextType
a} :: SynthesisTask)

-- | Voice ID to use for the synthesis.
synthesisTask_voiceId :: Lens.Lens' SynthesisTask (Prelude.Maybe VoiceId)
synthesisTask_voiceId :: (Maybe VoiceId -> f (Maybe VoiceId))
-> SynthesisTask -> f SynthesisTask
synthesisTask_voiceId = (SynthesisTask -> Maybe VoiceId)
-> (SynthesisTask -> Maybe VoiceId -> SynthesisTask)
-> Lens SynthesisTask SynthesisTask (Maybe VoiceId) (Maybe VoiceId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe VoiceId
voiceId :: Maybe VoiceId
$sel:voiceId:SynthesisTask' :: SynthesisTask -> Maybe VoiceId
voiceId} -> Maybe VoiceId
voiceId) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe VoiceId
a -> SynthesisTask
s {$sel:voiceId:SynthesisTask' :: Maybe VoiceId
voiceId = Maybe VoiceId
a} :: SynthesisTask)

-- | List of one or more pronunciation lexicon names you want the service to
-- apply during synthesis. Lexicons are applied only if the language of the
-- lexicon is the same as the language of the voice.
synthesisTask_lexiconNames :: Lens.Lens' SynthesisTask (Prelude.Maybe [Prelude.Text])
synthesisTask_lexiconNames :: (Maybe [Text] -> f (Maybe [Text]))
-> SynthesisTask -> f SynthesisTask
synthesisTask_lexiconNames = (SynthesisTask -> Maybe [Text])
-> (SynthesisTask -> Maybe [Text] -> SynthesisTask)
-> Lens SynthesisTask SynthesisTask (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe [Text]
lexiconNames :: Maybe [Text]
$sel:lexiconNames:SynthesisTask' :: SynthesisTask -> Maybe [Text]
lexiconNames} -> Maybe [Text]
lexiconNames) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe [Text]
a -> SynthesisTask
s {$sel:lexiconNames:SynthesisTask' :: Maybe [Text]
lexiconNames = Maybe [Text]
a} :: SynthesisTask) ((Maybe [Text] -> f (Maybe [Text]))
 -> SynthesisTask -> f SynthesisTask)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SynthesisTask
-> f SynthesisTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Current status of the individual speech synthesis task.
synthesisTask_taskStatus :: Lens.Lens' SynthesisTask (Prelude.Maybe TaskStatus)
synthesisTask_taskStatus :: (Maybe TaskStatus -> f (Maybe TaskStatus))
-> SynthesisTask -> f SynthesisTask
synthesisTask_taskStatus = (SynthesisTask -> Maybe TaskStatus)
-> (SynthesisTask -> Maybe TaskStatus -> SynthesisTask)
-> Lens
     SynthesisTask SynthesisTask (Maybe TaskStatus) (Maybe TaskStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe TaskStatus
taskStatus :: Maybe TaskStatus
$sel:taskStatus:SynthesisTask' :: SynthesisTask -> Maybe TaskStatus
taskStatus} -> Maybe TaskStatus
taskStatus) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe TaskStatus
a -> SynthesisTask
s {$sel:taskStatus:SynthesisTask' :: Maybe TaskStatus
taskStatus = Maybe TaskStatus
a} :: SynthesisTask)

-- | Pathway for the output speech file.
synthesisTask_outputUri :: Lens.Lens' SynthesisTask (Prelude.Maybe Prelude.Text)
synthesisTask_outputUri :: (Maybe Text -> f (Maybe Text)) -> SynthesisTask -> f SynthesisTask
synthesisTask_outputUri = (SynthesisTask -> Maybe Text)
-> (SynthesisTask -> Maybe Text -> SynthesisTask)
-> Lens SynthesisTask SynthesisTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesisTask' {Maybe Text
outputUri :: Maybe Text
$sel:outputUri:SynthesisTask' :: SynthesisTask -> Maybe Text
outputUri} -> Maybe Text
outputUri) (\s :: SynthesisTask
s@SynthesisTask' {} Maybe Text
a -> SynthesisTask
s {$sel:outputUri:SynthesisTask' :: Maybe Text
outputUri = Maybe Text
a} :: SynthesisTask)

instance Core.FromJSON SynthesisTask where
  parseJSON :: Value -> Parser SynthesisTask
parseJSON =
    String
-> (Object -> Parser SynthesisTask)
-> Value
-> Parser SynthesisTask
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SynthesisTask"
      ( \Object
x ->
          Maybe POSIX
-> Maybe LanguageCode
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Engine
-> Maybe [SpeechMarkType]
-> Maybe Text
-> Maybe OutputFormat
-> Maybe TextType
-> Maybe VoiceId
-> Maybe [Text]
-> Maybe TaskStatus
-> Maybe Text
-> SynthesisTask
SynthesisTask'
            (Maybe POSIX
 -> Maybe LanguageCode
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Engine
 -> Maybe [SpeechMarkType]
 -> Maybe Text
 -> Maybe OutputFormat
 -> Maybe TextType
 -> Maybe VoiceId
 -> Maybe [Text]
 -> Maybe TaskStatus
 -> Maybe Text
 -> SynthesisTask)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe LanguageCode
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Engine
      -> Maybe [SpeechMarkType]
      -> Maybe Text
      -> Maybe OutputFormat
      -> Maybe TextType
      -> Maybe VoiceId
      -> Maybe [Text]
      -> Maybe TaskStatus
      -> Maybe Text
      -> SynthesisTask)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
            Parser
  (Maybe LanguageCode
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Engine
   -> Maybe [SpeechMarkType]
   -> Maybe Text
   -> Maybe OutputFormat
   -> Maybe TextType
   -> Maybe VoiceId
   -> Maybe [Text]
   -> Maybe TaskStatus
   -> Maybe Text
   -> SynthesisTask)
-> Parser (Maybe LanguageCode)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Engine
      -> Maybe [SpeechMarkType]
      -> Maybe Text
      -> Maybe OutputFormat
      -> Maybe TextType
      -> Maybe VoiceId
      -> Maybe [Text]
      -> Maybe TaskStatus
      -> Maybe Text
      -> SynthesisTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LanguageCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LanguageCode")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Engine
   -> Maybe [SpeechMarkType]
   -> Maybe Text
   -> Maybe OutputFormat
   -> Maybe TextType
   -> Maybe VoiceId
   -> Maybe [Text]
   -> Maybe TaskStatus
   -> Maybe Text
   -> SynthesisTask)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Engine
      -> Maybe [SpeechMarkType]
      -> Maybe Text
      -> Maybe OutputFormat
      -> Maybe TextType
      -> Maybe VoiceId
      -> Maybe [Text]
      -> Maybe TaskStatus
      -> Maybe Text
      -> SynthesisTask)
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
"SnsTopicArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Engine
   -> Maybe [SpeechMarkType]
   -> Maybe Text
   -> Maybe OutputFormat
   -> Maybe TextType
   -> Maybe VoiceId
   -> Maybe [Text]
   -> Maybe TaskStatus
   -> Maybe Text
   -> SynthesisTask)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Engine
      -> Maybe [SpeechMarkType]
      -> Maybe Text
      -> Maybe OutputFormat
      -> Maybe TextType
      -> Maybe VoiceId
      -> Maybe [Text]
      -> Maybe TaskStatus
      -> Maybe Text
      -> SynthesisTask)
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
"TaskStatusReason")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Engine
   -> Maybe [SpeechMarkType]
   -> Maybe Text
   -> Maybe OutputFormat
   -> Maybe TextType
   -> Maybe VoiceId
   -> Maybe [Text]
   -> Maybe TaskStatus
   -> Maybe Text
   -> SynthesisTask)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Engine
      -> Maybe [SpeechMarkType]
      -> Maybe Text
      -> Maybe OutputFormat
      -> Maybe TextType
      -> Maybe VoiceId
      -> Maybe [Text]
      -> Maybe TaskStatus
      -> Maybe Text
      -> SynthesisTask)
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
"TaskId")
            Parser
  (Maybe Int
   -> Maybe Engine
   -> Maybe [SpeechMarkType]
   -> Maybe Text
   -> Maybe OutputFormat
   -> Maybe TextType
   -> Maybe VoiceId
   -> Maybe [Text]
   -> Maybe TaskStatus
   -> Maybe Text
   -> SynthesisTask)
-> Parser (Maybe Int)
-> Parser
     (Maybe Engine
      -> Maybe [SpeechMarkType]
      -> Maybe Text
      -> Maybe OutputFormat
      -> Maybe TextType
      -> Maybe VoiceId
      -> Maybe [Text]
      -> Maybe TaskStatus
      -> Maybe Text
      -> SynthesisTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RequestCharacters")
            Parser
  (Maybe Engine
   -> Maybe [SpeechMarkType]
   -> Maybe Text
   -> Maybe OutputFormat
   -> Maybe TextType
   -> Maybe VoiceId
   -> Maybe [Text]
   -> Maybe TaskStatus
   -> Maybe Text
   -> SynthesisTask)
-> Parser (Maybe Engine)
-> Parser
     (Maybe [SpeechMarkType]
      -> Maybe Text
      -> Maybe OutputFormat
      -> Maybe TextType
      -> Maybe VoiceId
      -> Maybe [Text]
      -> Maybe TaskStatus
      -> Maybe Text
      -> SynthesisTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Engine)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Engine")
            Parser
  (Maybe [SpeechMarkType]
   -> Maybe Text
   -> Maybe OutputFormat
   -> Maybe TextType
   -> Maybe VoiceId
   -> Maybe [Text]
   -> Maybe TaskStatus
   -> Maybe Text
   -> SynthesisTask)
-> Parser (Maybe [SpeechMarkType])
-> Parser
     (Maybe Text
      -> Maybe OutputFormat
      -> Maybe TextType
      -> Maybe VoiceId
      -> Maybe [Text]
      -> Maybe TaskStatus
      -> Maybe Text
      -> SynthesisTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [SpeechMarkType]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SpeechMarkTypes"
                            Parser (Maybe (Maybe [SpeechMarkType]))
-> Maybe [SpeechMarkType] -> Parser (Maybe [SpeechMarkType])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SpeechMarkType]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe OutputFormat
   -> Maybe TextType
   -> Maybe VoiceId
   -> Maybe [Text]
   -> Maybe TaskStatus
   -> Maybe Text
   -> SynthesisTask)
-> Parser (Maybe Text)
-> Parser
     (Maybe OutputFormat
      -> Maybe TextType
      -> Maybe VoiceId
      -> Maybe [Text]
      -> Maybe TaskStatus
      -> Maybe Text
      -> SynthesisTask)
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
"SampleRate")
            Parser
  (Maybe OutputFormat
   -> Maybe TextType
   -> Maybe VoiceId
   -> Maybe [Text]
   -> Maybe TaskStatus
   -> Maybe Text
   -> SynthesisTask)
-> Parser (Maybe OutputFormat)
-> Parser
     (Maybe TextType
      -> Maybe VoiceId
      -> Maybe [Text]
      -> Maybe TaskStatus
      -> Maybe Text
      -> SynthesisTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OutputFormat)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OutputFormat")
            Parser
  (Maybe TextType
   -> Maybe VoiceId
   -> Maybe [Text]
   -> Maybe TaskStatus
   -> Maybe Text
   -> SynthesisTask)
-> Parser (Maybe TextType)
-> Parser
     (Maybe VoiceId
      -> Maybe [Text] -> Maybe TaskStatus -> Maybe Text -> SynthesisTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TextType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TextType")
            Parser
  (Maybe VoiceId
   -> Maybe [Text] -> Maybe TaskStatus -> Maybe Text -> SynthesisTask)
-> Parser (Maybe VoiceId)
-> Parser
     (Maybe [Text] -> Maybe TaskStatus -> Maybe Text -> SynthesisTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VoiceId)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VoiceId")
            Parser
  (Maybe [Text] -> Maybe TaskStatus -> Maybe Text -> SynthesisTask)
-> Parser (Maybe [Text])
-> Parser (Maybe TaskStatus -> Maybe Text -> SynthesisTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LexiconNames" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe TaskStatus -> Maybe Text -> SynthesisTask)
-> Parser (Maybe TaskStatus)
-> Parser (Maybe Text -> SynthesisTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TaskStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TaskStatus")
            Parser (Maybe Text -> SynthesisTask)
-> Parser (Maybe Text) -> Parser SynthesisTask
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
"OutputUri")
      )

instance Prelude.Hashable SynthesisTask

instance Prelude.NFData SynthesisTask