{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Speech.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data RecognitionMetadataOriginalMediaType
= OriginalMediaTypeUnspecified
| Audio
| Video
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable RecognitionMetadataOriginalMediaType
instance FromHttpApiData RecognitionMetadataOriginalMediaType where
parseQueryParam = \case
"ORIGINAL_MEDIA_TYPE_UNSPECIFIED" -> Right OriginalMediaTypeUnspecified
"AUDIO" -> Right Audio
"VIDEO" -> Right Video
x -> Left ("Unable to parse RecognitionMetadataOriginalMediaType from: " <> x)
instance ToHttpApiData RecognitionMetadataOriginalMediaType where
toQueryParam = \case
OriginalMediaTypeUnspecified -> "ORIGINAL_MEDIA_TYPE_UNSPECIFIED"
Audio -> "AUDIO"
Video -> "VIDEO"
instance FromJSON RecognitionMetadataOriginalMediaType where
parseJSON = parseJSONText "RecognitionMetadataOriginalMediaType"
instance ToJSON RecognitionMetadataOriginalMediaType where
toJSON = toJSONText
data RecognitionMetadataInteractionType
= InteractionTypeUnspecified
| Discussion
| Presentation
| PhoneCall
| Voicemail
| ProfessionallyProduced
| VoiceSearch
| VoiceCommand
| Dictation
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable RecognitionMetadataInteractionType
instance FromHttpApiData RecognitionMetadataInteractionType where
parseQueryParam = \case
"INTERACTION_TYPE_UNSPECIFIED" -> Right InteractionTypeUnspecified
"DISCUSSION" -> Right Discussion
"PRESENTATION" -> Right Presentation
"PHONE_CALL" -> Right PhoneCall
"VOICEMAIL" -> Right Voicemail
"PROFESSIONALLY_PRODUCED" -> Right ProfessionallyProduced
"VOICE_SEARCH" -> Right VoiceSearch
"VOICE_COMMAND" -> Right VoiceCommand
"DICTATION" -> Right Dictation
x -> Left ("Unable to parse RecognitionMetadataInteractionType from: " <> x)
instance ToHttpApiData RecognitionMetadataInteractionType where
toQueryParam = \case
InteractionTypeUnspecified -> "INTERACTION_TYPE_UNSPECIFIED"
Discussion -> "DISCUSSION"
Presentation -> "PRESENTATION"
PhoneCall -> "PHONE_CALL"
Voicemail -> "VOICEMAIL"
ProfessionallyProduced -> "PROFESSIONALLY_PRODUCED"
VoiceSearch -> "VOICE_SEARCH"
VoiceCommand -> "VOICE_COMMAND"
Dictation -> "DICTATION"
instance FromJSON RecognitionMetadataInteractionType where
parseJSON = parseJSONText "RecognitionMetadataInteractionType"
instance ToJSON RecognitionMetadataInteractionType where
toJSON = toJSONText
data RecognitionMetadataRecordingDeviceType
= RecordingDeviceTypeUnspecified
| Smartphone
| PC
| PhoneLine
| Vehicle
| OtherOutdoorDevice
| OtherIndoorDevice
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable RecognitionMetadataRecordingDeviceType
instance FromHttpApiData RecognitionMetadataRecordingDeviceType where
parseQueryParam = \case
"RECORDING_DEVICE_TYPE_UNSPECIFIED" -> Right RecordingDeviceTypeUnspecified
"SMARTPHONE" -> Right Smartphone
"PC" -> Right PC
"PHONE_LINE" -> Right PhoneLine
"VEHICLE" -> Right Vehicle
"OTHER_OUTDOOR_DEVICE" -> Right OtherOutdoorDevice
"OTHER_INDOOR_DEVICE" -> Right OtherIndoorDevice
x -> Left ("Unable to parse RecognitionMetadataRecordingDeviceType from: " <> x)
instance ToHttpApiData RecognitionMetadataRecordingDeviceType where
toQueryParam = \case
RecordingDeviceTypeUnspecified -> "RECORDING_DEVICE_TYPE_UNSPECIFIED"
Smartphone -> "SMARTPHONE"
PC -> "PC"
PhoneLine -> "PHONE_LINE"
Vehicle -> "VEHICLE"
OtherOutdoorDevice -> "OTHER_OUTDOOR_DEVICE"
OtherIndoorDevice -> "OTHER_INDOOR_DEVICE"
instance FromJSON RecognitionMetadataRecordingDeviceType where
parseJSON = parseJSONText "RecognitionMetadataRecordingDeviceType"
instance ToJSON RecognitionMetadataRecordingDeviceType where
toJSON = toJSONText
data RecognitionMetadataMicrophoneDistance
= MicrophoneDistanceUnspecified
| Nearfield
| Midfield
| Farfield
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable RecognitionMetadataMicrophoneDistance
instance FromHttpApiData RecognitionMetadataMicrophoneDistance where
parseQueryParam = \case
"MICROPHONE_DISTANCE_UNSPECIFIED" -> Right MicrophoneDistanceUnspecified
"NEARFIELD" -> Right Nearfield
"MIDFIELD" -> Right Midfield
"FARFIELD" -> Right Farfield
x -> Left ("Unable to parse RecognitionMetadataMicrophoneDistance from: " <> x)
instance ToHttpApiData RecognitionMetadataMicrophoneDistance where
toQueryParam = \case
MicrophoneDistanceUnspecified -> "MICROPHONE_DISTANCE_UNSPECIFIED"
Nearfield -> "NEARFIELD"
Midfield -> "MIDFIELD"
Farfield -> "FARFIELD"
instance FromJSON RecognitionMetadataMicrophoneDistance where
parseJSON = parseJSONText "RecognitionMetadataMicrophoneDistance"
instance ToJSON RecognitionMetadataMicrophoneDistance 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 RecognitionConfigEncoding
= EncodingUnspecified
| LINEAR16
| Flac
| Mulaw
| Amr
| AmrWb
| OggOpus
| SpeexWithHeaderByte
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable RecognitionConfigEncoding
instance FromHttpApiData RecognitionConfigEncoding where
parseQueryParam = \case
"ENCODING_UNSPECIFIED" -> Right EncodingUnspecified
"LINEAR16" -> Right LINEAR16
"FLAC" -> Right Flac
"MULAW" -> Right Mulaw
"AMR" -> Right Amr
"AMR_WB" -> Right AmrWb
"OGG_OPUS" -> Right OggOpus
"SPEEX_WITH_HEADER_BYTE" -> Right SpeexWithHeaderByte
x -> Left ("Unable to parse RecognitionConfigEncoding from: " <> x)
instance ToHttpApiData RecognitionConfigEncoding where
toQueryParam = \case
EncodingUnspecified -> "ENCODING_UNSPECIFIED"
LINEAR16 -> "LINEAR16"
Flac -> "FLAC"
Mulaw -> "MULAW"
Amr -> "AMR"
AmrWb -> "AMR_WB"
OggOpus -> "OGG_OPUS"
SpeexWithHeaderByte -> "SPEEX_WITH_HEADER_BYTE"
instance FromJSON RecognitionConfigEncoding where
parseJSON = parseJSONText "RecognitionConfigEncoding"
instance ToJSON RecognitionConfigEncoding where
toJSON = toJSONText