{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.TextToSpeech.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data VoiceSelectionParamsSsmlGender
= SsmlVoiceGenderUnspecified
| Male
| Female
| Neutral
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable VoiceSelectionParamsSsmlGender
instance FromHttpApiData VoiceSelectionParamsSsmlGender where
parseQueryParam = \case
"SSML_VOICE_GENDER_UNSPECIFIED" -> Right SsmlVoiceGenderUnspecified
"MALE" -> Right Male
"FEMALE" -> Right Female
"NEUTRAL" -> Right Neutral
x -> Left ("Unable to parse VoiceSelectionParamsSsmlGender from: " <> x)
instance ToHttpApiData VoiceSelectionParamsSsmlGender where
toQueryParam = \case
SsmlVoiceGenderUnspecified -> "SSML_VOICE_GENDER_UNSPECIFIED"
Male -> "MALE"
Female -> "FEMALE"
Neutral -> "NEUTRAL"
instance FromJSON VoiceSelectionParamsSsmlGender where
parseJSON = parseJSONText "VoiceSelectionParamsSsmlGender"
instance ToJSON VoiceSelectionParamsSsmlGender where
toJSON = toJSONText
data Xgafv
= X1
| X2
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable Xgafv
instance FromHttpApiData Xgafv where
parseQueryParam = \case
"1" -> Right X1
"2" -> Right X2
x -> Left ("Unable to parse Xgafv from: " <> x)
instance ToHttpApiData Xgafv where
toQueryParam = \case
X1 -> "1"
X2 -> "2"
instance FromJSON Xgafv where
parseJSON = parseJSONText "Xgafv"
instance ToJSON Xgafv where
toJSON = toJSONText
data VoiceSsmlGender
= VSGSsmlVoiceGenderUnspecified
| VSGMale
| VSGFemale
| VSGNeutral
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable VoiceSsmlGender
instance FromHttpApiData VoiceSsmlGender where
parseQueryParam = \case
"SSML_VOICE_GENDER_UNSPECIFIED" -> Right VSGSsmlVoiceGenderUnspecified
"MALE" -> Right VSGMale
"FEMALE" -> Right VSGFemale
"NEUTRAL" -> Right VSGNeutral
x -> Left ("Unable to parse VoiceSsmlGender from: " <> x)
instance ToHttpApiData VoiceSsmlGender where
toQueryParam = \case
VSGSsmlVoiceGenderUnspecified -> "SSML_VOICE_GENDER_UNSPECIFIED"
VSGMale -> "MALE"
VSGFemale -> "FEMALE"
VSGNeutral -> "NEUTRAL"
instance FromJSON VoiceSsmlGender where
parseJSON = parseJSONText "VoiceSsmlGender"
instance ToJSON VoiceSsmlGender where
toJSON = toJSONText
data AudioConfigAudioEncoding
= AudioEncodingUnspecified
| LINEAR16
| MP3
| OggOpus
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AudioConfigAudioEncoding
instance FromHttpApiData AudioConfigAudioEncoding where
parseQueryParam = \case
"AUDIO_ENCODING_UNSPECIFIED" -> Right AudioEncodingUnspecified
"LINEAR16" -> Right LINEAR16
"MP3" -> Right MP3
"OGG_OPUS" -> Right OggOpus
x -> Left ("Unable to parse AudioConfigAudioEncoding from: " <> x)
instance ToHttpApiData AudioConfigAudioEncoding where
toQueryParam = \case
AudioEncodingUnspecified -> "AUDIO_ENCODING_UNSPECIFIED"
LINEAR16 -> "LINEAR16"
MP3 -> "MP3"
OggOpus -> "OGG_OPUS"
instance FromJSON AudioConfigAudioEncoding where
parseJSON = parseJSONText "AudioConfigAudioEncoding"
instance ToJSON AudioConfigAudioEncoding where
toJSON = toJSONText