{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Polly.SynthesizeSpeech
(
SynthesizeSpeech (..),
newSynthesizeSpeech,
synthesizeSpeech_languageCode,
synthesizeSpeech_engine,
synthesizeSpeech_speechMarkTypes,
synthesizeSpeech_sampleRate,
synthesizeSpeech_textType,
synthesizeSpeech_lexiconNames,
synthesizeSpeech_outputFormat,
synthesizeSpeech_text,
synthesizeSpeech_voiceId,
SynthesizeSpeechResponse (..),
newSynthesizeSpeechResponse,
synthesizeSpeechResponse_requestCharacters,
synthesizeSpeechResponse_contentType,
synthesizeSpeechResponse_httpStatus,
synthesizeSpeechResponse_audioStream,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Polly.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data SynthesizeSpeech = SynthesizeSpeech'
{
SynthesizeSpeech -> Maybe LanguageCode
languageCode :: Prelude.Maybe LanguageCode,
SynthesizeSpeech -> Maybe Engine
engine :: Prelude.Maybe Engine,
SynthesizeSpeech -> Maybe [SpeechMarkType]
speechMarkTypes :: Prelude.Maybe [SpeechMarkType],
SynthesizeSpeech -> Maybe Text
sampleRate :: Prelude.Maybe Prelude.Text,
SynthesizeSpeech -> Maybe TextType
textType :: Prelude.Maybe TextType,
SynthesizeSpeech -> Maybe [Text]
lexiconNames :: Prelude.Maybe [Prelude.Text],
SynthesizeSpeech -> OutputFormat
outputFormat :: OutputFormat,
SynthesizeSpeech -> Text
text :: Prelude.Text,
SynthesizeSpeech -> VoiceId
voiceId :: VoiceId
}
deriving (SynthesizeSpeech -> SynthesizeSpeech -> Bool
(SynthesizeSpeech -> SynthesizeSpeech -> Bool)
-> (SynthesizeSpeech -> SynthesizeSpeech -> Bool)
-> Eq SynthesizeSpeech
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SynthesizeSpeech -> SynthesizeSpeech -> Bool
$c/= :: SynthesizeSpeech -> SynthesizeSpeech -> Bool
== :: SynthesizeSpeech -> SynthesizeSpeech -> Bool
$c== :: SynthesizeSpeech -> SynthesizeSpeech -> Bool
Prelude.Eq, ReadPrec [SynthesizeSpeech]
ReadPrec SynthesizeSpeech
Int -> ReadS SynthesizeSpeech
ReadS [SynthesizeSpeech]
(Int -> ReadS SynthesizeSpeech)
-> ReadS [SynthesizeSpeech]
-> ReadPrec SynthesizeSpeech
-> ReadPrec [SynthesizeSpeech]
-> Read SynthesizeSpeech
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SynthesizeSpeech]
$creadListPrec :: ReadPrec [SynthesizeSpeech]
readPrec :: ReadPrec SynthesizeSpeech
$creadPrec :: ReadPrec SynthesizeSpeech
readList :: ReadS [SynthesizeSpeech]
$creadList :: ReadS [SynthesizeSpeech]
readsPrec :: Int -> ReadS SynthesizeSpeech
$creadsPrec :: Int -> ReadS SynthesizeSpeech
Prelude.Read, Int -> SynthesizeSpeech -> ShowS
[SynthesizeSpeech] -> ShowS
SynthesizeSpeech -> String
(Int -> SynthesizeSpeech -> ShowS)
-> (SynthesizeSpeech -> String)
-> ([SynthesizeSpeech] -> ShowS)
-> Show SynthesizeSpeech
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SynthesizeSpeech] -> ShowS
$cshowList :: [SynthesizeSpeech] -> ShowS
show :: SynthesizeSpeech -> String
$cshow :: SynthesizeSpeech -> String
showsPrec :: Int -> SynthesizeSpeech -> ShowS
$cshowsPrec :: Int -> SynthesizeSpeech -> ShowS
Prelude.Show, (forall x. SynthesizeSpeech -> Rep SynthesizeSpeech x)
-> (forall x. Rep SynthesizeSpeech x -> SynthesizeSpeech)
-> Generic SynthesizeSpeech
forall x. Rep SynthesizeSpeech x -> SynthesizeSpeech
forall x. SynthesizeSpeech -> Rep SynthesizeSpeech x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SynthesizeSpeech x -> SynthesizeSpeech
$cfrom :: forall x. SynthesizeSpeech -> Rep SynthesizeSpeech x
Prelude.Generic)
newSynthesizeSpeech ::
OutputFormat ->
Prelude.Text ->
VoiceId ->
SynthesizeSpeech
newSynthesizeSpeech :: OutputFormat -> Text -> VoiceId -> SynthesizeSpeech
newSynthesizeSpeech OutputFormat
pOutputFormat_ Text
pText_ VoiceId
pVoiceId_ =
SynthesizeSpeech' :: Maybe LanguageCode
-> Maybe Engine
-> Maybe [SpeechMarkType]
-> Maybe Text
-> Maybe TextType
-> Maybe [Text]
-> OutputFormat
-> Text
-> VoiceId
-> SynthesizeSpeech
SynthesizeSpeech'
{ $sel:languageCode:SynthesizeSpeech' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
forall a. Maybe a
Prelude.Nothing,
$sel:engine:SynthesizeSpeech' :: Maybe Engine
engine = Maybe Engine
forall a. Maybe a
Prelude.Nothing,
$sel:speechMarkTypes:SynthesizeSpeech' :: Maybe [SpeechMarkType]
speechMarkTypes = Maybe [SpeechMarkType]
forall a. Maybe a
Prelude.Nothing,
$sel:sampleRate:SynthesizeSpeech' :: Maybe Text
sampleRate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:textType:SynthesizeSpeech' :: Maybe TextType
textType = Maybe TextType
forall a. Maybe a
Prelude.Nothing,
$sel:lexiconNames:SynthesizeSpeech' :: Maybe [Text]
lexiconNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:outputFormat:SynthesizeSpeech' :: OutputFormat
outputFormat = OutputFormat
pOutputFormat_,
$sel:text:SynthesizeSpeech' :: Text
text = Text
pText_,
$sel:voiceId:SynthesizeSpeech' :: VoiceId
voiceId = VoiceId
pVoiceId_
}
synthesizeSpeech_languageCode :: Lens.Lens' SynthesizeSpeech (Prelude.Maybe LanguageCode)
synthesizeSpeech_languageCode :: (Maybe LanguageCode -> f (Maybe LanguageCode))
-> SynthesizeSpeech -> f SynthesizeSpeech
synthesizeSpeech_languageCode = (SynthesizeSpeech -> Maybe LanguageCode)
-> (SynthesizeSpeech -> Maybe LanguageCode -> SynthesizeSpeech)
-> Lens
SynthesizeSpeech
SynthesizeSpeech
(Maybe LanguageCode)
(Maybe LanguageCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeech' {Maybe LanguageCode
languageCode :: Maybe LanguageCode
$sel:languageCode:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe LanguageCode
languageCode} -> Maybe LanguageCode
languageCode) (\s :: SynthesizeSpeech
s@SynthesizeSpeech' {} Maybe LanguageCode
a -> SynthesizeSpeech
s {$sel:languageCode:SynthesizeSpeech' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
a} :: SynthesizeSpeech)
synthesizeSpeech_engine :: Lens.Lens' SynthesizeSpeech (Prelude.Maybe Engine)
synthesizeSpeech_engine :: (Maybe Engine -> f (Maybe Engine))
-> SynthesizeSpeech -> f SynthesizeSpeech
synthesizeSpeech_engine = (SynthesizeSpeech -> Maybe Engine)
-> (SynthesizeSpeech -> Maybe Engine -> SynthesizeSpeech)
-> Lens
SynthesizeSpeech SynthesizeSpeech (Maybe Engine) (Maybe Engine)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeech' {Maybe Engine
engine :: Maybe Engine
$sel:engine:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe Engine
engine} -> Maybe Engine
engine) (\s :: SynthesizeSpeech
s@SynthesizeSpeech' {} Maybe Engine
a -> SynthesizeSpeech
s {$sel:engine:SynthesizeSpeech' :: Maybe Engine
engine = Maybe Engine
a} :: SynthesizeSpeech)
synthesizeSpeech_speechMarkTypes :: Lens.Lens' SynthesizeSpeech (Prelude.Maybe [SpeechMarkType])
synthesizeSpeech_speechMarkTypes :: (Maybe [SpeechMarkType] -> f (Maybe [SpeechMarkType]))
-> SynthesizeSpeech -> f SynthesizeSpeech
synthesizeSpeech_speechMarkTypes = (SynthesizeSpeech -> Maybe [SpeechMarkType])
-> (SynthesizeSpeech -> Maybe [SpeechMarkType] -> SynthesizeSpeech)
-> Lens
SynthesizeSpeech
SynthesizeSpeech
(Maybe [SpeechMarkType])
(Maybe [SpeechMarkType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeech' {Maybe [SpeechMarkType]
speechMarkTypes :: Maybe [SpeechMarkType]
$sel:speechMarkTypes:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe [SpeechMarkType]
speechMarkTypes} -> Maybe [SpeechMarkType]
speechMarkTypes) (\s :: SynthesizeSpeech
s@SynthesizeSpeech' {} Maybe [SpeechMarkType]
a -> SynthesizeSpeech
s {$sel:speechMarkTypes:SynthesizeSpeech' :: Maybe [SpeechMarkType]
speechMarkTypes = Maybe [SpeechMarkType]
a} :: SynthesizeSpeech) ((Maybe [SpeechMarkType] -> f (Maybe [SpeechMarkType]))
-> SynthesizeSpeech -> f SynthesizeSpeech)
-> ((Maybe [SpeechMarkType] -> f (Maybe [SpeechMarkType]))
-> Maybe [SpeechMarkType] -> f (Maybe [SpeechMarkType]))
-> (Maybe [SpeechMarkType] -> f (Maybe [SpeechMarkType]))
-> SynthesizeSpeech
-> f SynthesizeSpeech
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
synthesizeSpeech_sampleRate :: Lens.Lens' SynthesizeSpeech (Prelude.Maybe Prelude.Text)
synthesizeSpeech_sampleRate :: (Maybe Text -> f (Maybe Text))
-> SynthesizeSpeech -> f SynthesizeSpeech
synthesizeSpeech_sampleRate = (SynthesizeSpeech -> Maybe Text)
-> (SynthesizeSpeech -> Maybe Text -> SynthesizeSpeech)
-> Lens SynthesizeSpeech SynthesizeSpeech (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeech' {Maybe Text
sampleRate :: Maybe Text
$sel:sampleRate:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe Text
sampleRate} -> Maybe Text
sampleRate) (\s :: SynthesizeSpeech
s@SynthesizeSpeech' {} Maybe Text
a -> SynthesizeSpeech
s {$sel:sampleRate:SynthesizeSpeech' :: Maybe Text
sampleRate = Maybe Text
a} :: SynthesizeSpeech)
synthesizeSpeech_textType :: Lens.Lens' SynthesizeSpeech (Prelude.Maybe TextType)
synthesizeSpeech_textType :: (Maybe TextType -> f (Maybe TextType))
-> SynthesizeSpeech -> f SynthesizeSpeech
synthesizeSpeech_textType = (SynthesizeSpeech -> Maybe TextType)
-> (SynthesizeSpeech -> Maybe TextType -> SynthesizeSpeech)
-> Lens
SynthesizeSpeech SynthesizeSpeech (Maybe TextType) (Maybe TextType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeech' {Maybe TextType
textType :: Maybe TextType
$sel:textType:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe TextType
textType} -> Maybe TextType
textType) (\s :: SynthesizeSpeech
s@SynthesizeSpeech' {} Maybe TextType
a -> SynthesizeSpeech
s {$sel:textType:SynthesizeSpeech' :: Maybe TextType
textType = Maybe TextType
a} :: SynthesizeSpeech)
synthesizeSpeech_lexiconNames :: Lens.Lens' SynthesizeSpeech (Prelude.Maybe [Prelude.Text])
synthesizeSpeech_lexiconNames :: (Maybe [Text] -> f (Maybe [Text]))
-> SynthesizeSpeech -> f SynthesizeSpeech
synthesizeSpeech_lexiconNames = (SynthesizeSpeech -> Maybe [Text])
-> (SynthesizeSpeech -> Maybe [Text] -> SynthesizeSpeech)
-> Lens
SynthesizeSpeech SynthesizeSpeech (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeech' {Maybe [Text]
lexiconNames :: Maybe [Text]
$sel:lexiconNames:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe [Text]
lexiconNames} -> Maybe [Text]
lexiconNames) (\s :: SynthesizeSpeech
s@SynthesizeSpeech' {} Maybe [Text]
a -> SynthesizeSpeech
s {$sel:lexiconNames:SynthesizeSpeech' :: Maybe [Text]
lexiconNames = Maybe [Text]
a} :: SynthesizeSpeech) ((Maybe [Text] -> f (Maybe [Text]))
-> SynthesizeSpeech -> f SynthesizeSpeech)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SynthesizeSpeech
-> f SynthesizeSpeech
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
synthesizeSpeech_outputFormat :: Lens.Lens' SynthesizeSpeech OutputFormat
synthesizeSpeech_outputFormat :: (OutputFormat -> f OutputFormat)
-> SynthesizeSpeech -> f SynthesizeSpeech
synthesizeSpeech_outputFormat = (SynthesizeSpeech -> OutputFormat)
-> (SynthesizeSpeech -> OutputFormat -> SynthesizeSpeech)
-> Lens SynthesizeSpeech SynthesizeSpeech OutputFormat OutputFormat
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeech' {OutputFormat
outputFormat :: OutputFormat
$sel:outputFormat:SynthesizeSpeech' :: SynthesizeSpeech -> OutputFormat
outputFormat} -> OutputFormat
outputFormat) (\s :: SynthesizeSpeech
s@SynthesizeSpeech' {} OutputFormat
a -> SynthesizeSpeech
s {$sel:outputFormat:SynthesizeSpeech' :: OutputFormat
outputFormat = OutputFormat
a} :: SynthesizeSpeech)
synthesizeSpeech_text :: Lens.Lens' SynthesizeSpeech Prelude.Text
synthesizeSpeech_text :: (Text -> f Text) -> SynthesizeSpeech -> f SynthesizeSpeech
synthesizeSpeech_text = (SynthesizeSpeech -> Text)
-> (SynthesizeSpeech -> Text -> SynthesizeSpeech)
-> Lens SynthesizeSpeech SynthesizeSpeech Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeech' {Text
text :: Text
$sel:text:SynthesizeSpeech' :: SynthesizeSpeech -> Text
text} -> Text
text) (\s :: SynthesizeSpeech
s@SynthesizeSpeech' {} Text
a -> SynthesizeSpeech
s {$sel:text:SynthesizeSpeech' :: Text
text = Text
a} :: SynthesizeSpeech)
synthesizeSpeech_voiceId :: Lens.Lens' SynthesizeSpeech VoiceId
synthesizeSpeech_voiceId :: (VoiceId -> f VoiceId) -> SynthesizeSpeech -> f SynthesizeSpeech
synthesizeSpeech_voiceId = (SynthesizeSpeech -> VoiceId)
-> (SynthesizeSpeech -> VoiceId -> SynthesizeSpeech)
-> Lens SynthesizeSpeech SynthesizeSpeech VoiceId VoiceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeech' {VoiceId
voiceId :: VoiceId
$sel:voiceId:SynthesizeSpeech' :: SynthesizeSpeech -> VoiceId
voiceId} -> VoiceId
voiceId) (\s :: SynthesizeSpeech
s@SynthesizeSpeech' {} VoiceId
a -> SynthesizeSpeech
s {$sel:voiceId:SynthesizeSpeech' :: VoiceId
voiceId = VoiceId
a} :: SynthesizeSpeech)
instance Core.AWSRequest SynthesizeSpeech where
type
AWSResponse SynthesizeSpeech =
SynthesizeSpeechResponse
request :: SynthesizeSpeech -> Request SynthesizeSpeech
request = Service -> SynthesizeSpeech -> Request SynthesizeSpeech
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SynthesizeSpeech
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SynthesizeSpeech)))
response =
(Int
-> ResponseHeaders
-> ResponseBody
-> Either String (AWSResponse SynthesizeSpeech))
-> Logger
-> Service
-> Proxy SynthesizeSpeech
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SynthesizeSpeech)))
forall (m :: * -> *) a.
MonadResource m =>
(Int
-> ResponseHeaders
-> ResponseBody
-> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveBody
( \Int
s ResponseHeaders
h ResponseBody
x ->
Maybe Int
-> Maybe Text -> Int -> ResponseBody -> SynthesizeSpeechResponse
SynthesizeSpeechResponse'
(Maybe Int
-> Maybe Text -> Int -> ResponseBody -> SynthesizeSpeechResponse)
-> Either String (Maybe Int)
-> Either
String
(Maybe Text -> Int -> ResponseBody -> SynthesizeSpeechResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Int)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amzn-RequestCharacters")
Either
String
(Maybe Text -> Int -> ResponseBody -> SynthesizeSpeechResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ResponseBody -> SynthesizeSpeechResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Type")
Either String (Int -> ResponseBody -> SynthesizeSpeechResponse)
-> Either String Int
-> Either String (ResponseBody -> SynthesizeSpeechResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either String (ResponseBody -> SynthesizeSpeechResponse)
-> Either String ResponseBody
-> Either String SynthesizeSpeechResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseBody -> Either String ResponseBody
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure ResponseBody
x)
)
instance Prelude.Hashable SynthesizeSpeech
instance Prelude.NFData SynthesizeSpeech
instance Core.ToHeaders SynthesizeSpeech where
toHeaders :: SynthesizeSpeech -> ResponseHeaders
toHeaders = ResponseHeaders -> SynthesizeSpeech -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON SynthesizeSpeech where
toJSON :: SynthesizeSpeech -> Value
toJSON SynthesizeSpeech' {Maybe [Text]
Maybe [SpeechMarkType]
Maybe Text
Maybe Engine
Maybe LanguageCode
Maybe TextType
Text
OutputFormat
VoiceId
voiceId :: VoiceId
text :: Text
outputFormat :: OutputFormat
lexiconNames :: Maybe [Text]
textType :: Maybe TextType
sampleRate :: Maybe Text
speechMarkTypes :: Maybe [SpeechMarkType]
engine :: Maybe Engine
languageCode :: Maybe LanguageCode
$sel:voiceId:SynthesizeSpeech' :: SynthesizeSpeech -> VoiceId
$sel:text:SynthesizeSpeech' :: SynthesizeSpeech -> Text
$sel:outputFormat:SynthesizeSpeech' :: SynthesizeSpeech -> OutputFormat
$sel:lexiconNames:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe [Text]
$sel:textType:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe TextType
$sel:sampleRate:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe Text
$sel:speechMarkTypes:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe [SpeechMarkType]
$sel:engine:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe Engine
$sel:languageCode:SynthesizeSpeech' :: SynthesizeSpeech -> Maybe LanguageCode
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"LanguageCode" Text -> LanguageCode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LanguageCode -> Pair) -> Maybe LanguageCode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LanguageCode
languageCode,
(Text
"Engine" Text -> Engine -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Engine -> Pair) -> Maybe Engine -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Engine
engine,
(Text
"SpeechMarkTypes" Text -> [SpeechMarkType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([SpeechMarkType] -> Pair) -> Maybe [SpeechMarkType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SpeechMarkType]
speechMarkTypes,
(Text
"SampleRate" 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
sampleRate,
(Text
"TextType" Text -> TextType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TextType -> Pair) -> Maybe TextType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TextType
textType,
(Text
"LexiconNames" 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]
lexiconNames,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"OutputFormat" Text -> OutputFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= OutputFormat
outputFormat),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Text" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
text),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"VoiceId" Text -> VoiceId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= VoiceId
voiceId)
]
)
instance Core.ToPath SynthesizeSpeech where
toPath :: SynthesizeSpeech -> ByteString
toPath = ByteString -> SynthesizeSpeech -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/speech"
instance Core.ToQuery SynthesizeSpeech where
toQuery :: SynthesizeSpeech -> QueryString
toQuery = QueryString -> SynthesizeSpeech -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SynthesizeSpeechResponse = SynthesizeSpeechResponse'
{
SynthesizeSpeechResponse -> Maybe Int
requestCharacters :: Prelude.Maybe Prelude.Int,
SynthesizeSpeechResponse -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
SynthesizeSpeechResponse -> Int
httpStatus :: Prelude.Int,
SynthesizeSpeechResponse -> ResponseBody
audioStream :: Core.ResponseBody
}
deriving (Int -> SynthesizeSpeechResponse -> ShowS
[SynthesizeSpeechResponse] -> ShowS
SynthesizeSpeechResponse -> String
(Int -> SynthesizeSpeechResponse -> ShowS)
-> (SynthesizeSpeechResponse -> String)
-> ([SynthesizeSpeechResponse] -> ShowS)
-> Show SynthesizeSpeechResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SynthesizeSpeechResponse] -> ShowS
$cshowList :: [SynthesizeSpeechResponse] -> ShowS
show :: SynthesizeSpeechResponse -> String
$cshow :: SynthesizeSpeechResponse -> String
showsPrec :: Int -> SynthesizeSpeechResponse -> ShowS
$cshowsPrec :: Int -> SynthesizeSpeechResponse -> ShowS
Prelude.Show, (forall x.
SynthesizeSpeechResponse -> Rep SynthesizeSpeechResponse x)
-> (forall x.
Rep SynthesizeSpeechResponse x -> SynthesizeSpeechResponse)
-> Generic SynthesizeSpeechResponse
forall x.
Rep SynthesizeSpeechResponse x -> SynthesizeSpeechResponse
forall x.
SynthesizeSpeechResponse -> Rep SynthesizeSpeechResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SynthesizeSpeechResponse x -> SynthesizeSpeechResponse
$cfrom :: forall x.
SynthesizeSpeechResponse -> Rep SynthesizeSpeechResponse x
Prelude.Generic)
newSynthesizeSpeechResponse ::
Prelude.Int ->
Core.ResponseBody ->
SynthesizeSpeechResponse
newSynthesizeSpeechResponse :: Int -> ResponseBody -> SynthesizeSpeechResponse
newSynthesizeSpeechResponse
Int
pHttpStatus_
ResponseBody
pAudioStream_ =
SynthesizeSpeechResponse' :: Maybe Int
-> Maybe Text -> Int -> ResponseBody -> SynthesizeSpeechResponse
SynthesizeSpeechResponse'
{ $sel:requestCharacters:SynthesizeSpeechResponse' :: Maybe Int
requestCharacters =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:contentType:SynthesizeSpeechResponse' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SynthesizeSpeechResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:audioStream:SynthesizeSpeechResponse' :: ResponseBody
audioStream = ResponseBody
pAudioStream_
}
synthesizeSpeechResponse_requestCharacters :: Lens.Lens' SynthesizeSpeechResponse (Prelude.Maybe Prelude.Int)
synthesizeSpeechResponse_requestCharacters :: (Maybe Int -> f (Maybe Int))
-> SynthesizeSpeechResponse -> f SynthesizeSpeechResponse
synthesizeSpeechResponse_requestCharacters = (SynthesizeSpeechResponse -> Maybe Int)
-> (SynthesizeSpeechResponse
-> Maybe Int -> SynthesizeSpeechResponse)
-> Lens
SynthesizeSpeechResponse
SynthesizeSpeechResponse
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeechResponse' {Maybe Int
requestCharacters :: Maybe Int
$sel:requestCharacters:SynthesizeSpeechResponse' :: SynthesizeSpeechResponse -> Maybe Int
requestCharacters} -> Maybe Int
requestCharacters) (\s :: SynthesizeSpeechResponse
s@SynthesizeSpeechResponse' {} Maybe Int
a -> SynthesizeSpeechResponse
s {$sel:requestCharacters:SynthesizeSpeechResponse' :: Maybe Int
requestCharacters = Maybe Int
a} :: SynthesizeSpeechResponse)
synthesizeSpeechResponse_contentType :: Lens.Lens' SynthesizeSpeechResponse (Prelude.Maybe Prelude.Text)
synthesizeSpeechResponse_contentType :: (Maybe Text -> f (Maybe Text))
-> SynthesizeSpeechResponse -> f SynthesizeSpeechResponse
synthesizeSpeechResponse_contentType = (SynthesizeSpeechResponse -> Maybe Text)
-> (SynthesizeSpeechResponse
-> Maybe Text -> SynthesizeSpeechResponse)
-> Lens
SynthesizeSpeechResponse
SynthesizeSpeechResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeechResponse' {Maybe Text
contentType :: Maybe Text
$sel:contentType:SynthesizeSpeechResponse' :: SynthesizeSpeechResponse -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: SynthesizeSpeechResponse
s@SynthesizeSpeechResponse' {} Maybe Text
a -> SynthesizeSpeechResponse
s {$sel:contentType:SynthesizeSpeechResponse' :: Maybe Text
contentType = Maybe Text
a} :: SynthesizeSpeechResponse)
synthesizeSpeechResponse_httpStatus :: Lens.Lens' SynthesizeSpeechResponse Prelude.Int
synthesizeSpeechResponse_httpStatus :: (Int -> f Int)
-> SynthesizeSpeechResponse -> f SynthesizeSpeechResponse
synthesizeSpeechResponse_httpStatus = (SynthesizeSpeechResponse -> Int)
-> (SynthesizeSpeechResponse -> Int -> SynthesizeSpeechResponse)
-> Lens SynthesizeSpeechResponse SynthesizeSpeechResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeechResponse' {Int
httpStatus :: Int
$sel:httpStatus:SynthesizeSpeechResponse' :: SynthesizeSpeechResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SynthesizeSpeechResponse
s@SynthesizeSpeechResponse' {} Int
a -> SynthesizeSpeechResponse
s {$sel:httpStatus:SynthesizeSpeechResponse' :: Int
httpStatus = Int
a} :: SynthesizeSpeechResponse)
synthesizeSpeechResponse_audioStream :: Lens.Lens' SynthesizeSpeechResponse Core.ResponseBody
synthesizeSpeechResponse_audioStream :: (ResponseBody -> f ResponseBody)
-> SynthesizeSpeechResponse -> f SynthesizeSpeechResponse
synthesizeSpeechResponse_audioStream = (SynthesizeSpeechResponse -> ResponseBody)
-> (SynthesizeSpeechResponse
-> ResponseBody -> SynthesizeSpeechResponse)
-> Lens
SynthesizeSpeechResponse
SynthesizeSpeechResponse
ResponseBody
ResponseBody
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SynthesizeSpeechResponse' {ResponseBody
audioStream :: ResponseBody
$sel:audioStream:SynthesizeSpeechResponse' :: SynthesizeSpeechResponse -> ResponseBody
audioStream} -> ResponseBody
audioStream) (\s :: SynthesizeSpeechResponse
s@SynthesizeSpeechResponse' {} ResponseBody
a -> SynthesizeSpeechResponse
s {$sel:audioStream:SynthesizeSpeechResponse' :: ResponseBody
audioStream = ResponseBody
a} :: SynthesizeSpeechResponse)