module TD.Query.RecognizeSpeechInFile
(RecognizeSpeechInFile(..)
, defaultRecognizeSpeechInFile
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.InputFile as InputFile
data RecognizeSpeechInFile
= RecognizeSpeechInFile
{ RecognizeSpeechInFile -> Maybe InputFile
audio_file :: Maybe InputFile.InputFile
, RecognizeSpeechInFile -> Maybe Int
recognition_id :: Maybe Int
}
deriving (RecognizeSpeechInFile -> RecognizeSpeechInFile -> Bool
(RecognizeSpeechInFile -> RecognizeSpeechInFile -> Bool)
-> (RecognizeSpeechInFile -> RecognizeSpeechInFile -> Bool)
-> Eq RecognizeSpeechInFile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RecognizeSpeechInFile -> RecognizeSpeechInFile -> Bool
== :: RecognizeSpeechInFile -> RecognizeSpeechInFile -> Bool
$c/= :: RecognizeSpeechInFile -> RecognizeSpeechInFile -> Bool
/= :: RecognizeSpeechInFile -> RecognizeSpeechInFile -> Bool
Eq, Int -> RecognizeSpeechInFile -> ShowS
[RecognizeSpeechInFile] -> ShowS
RecognizeSpeechInFile -> String
(Int -> RecognizeSpeechInFile -> ShowS)
-> (RecognizeSpeechInFile -> String)
-> ([RecognizeSpeechInFile] -> ShowS)
-> Show RecognizeSpeechInFile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RecognizeSpeechInFile -> ShowS
showsPrec :: Int -> RecognizeSpeechInFile -> ShowS
$cshow :: RecognizeSpeechInFile -> String
show :: RecognizeSpeechInFile -> String
$cshowList :: [RecognizeSpeechInFile] -> ShowS
showList :: [RecognizeSpeechInFile] -> ShowS
Show)
instance I.ShortShow RecognizeSpeechInFile where
shortShow :: RecognizeSpeechInFile -> String
shortShow
RecognizeSpeechInFile
{ audio_file :: RecognizeSpeechInFile -> Maybe InputFile
audio_file = Maybe InputFile
audio_file_
, recognition_id :: RecognizeSpeechInFile -> Maybe Int
recognition_id = Maybe Int
recognition_id_
}
= String
"RecognizeSpeechInFile"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"audio_file" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
audio_file_
, String
"recognition_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
recognition_id_
]
instance AT.ToJSON RecognizeSpeechInFile where
toJSON :: RecognizeSpeechInFile -> Value
toJSON
RecognizeSpeechInFile
{ audio_file :: RecognizeSpeechInFile -> Maybe InputFile
audio_file = Maybe InputFile
audio_file_
, recognition_id :: RecognizeSpeechInFile -> Maybe Int
recognition_id = Maybe Int
recognition_id_
}
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"recognizeSpeechInFile"
, Key
"audio_file" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
audio_file_
, Key
"recognition_id" Key -> Maybe Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= (Int -> Value) -> Maybe Int -> Maybe Value
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Value
I.writeInt64 Maybe Int
recognition_id_
]
defaultRecognizeSpeechInFile :: RecognizeSpeechInFile
defaultRecognizeSpeechInFile :: RecognizeSpeechInFile
defaultRecognizeSpeechInFile =
RecognizeSpeechInFile
{ audio_file :: Maybe InputFile
audio_file = Maybe InputFile
forall a. Maybe a
Nothing
, recognition_id :: Maybe Int
recognition_id = Maybe Int
forall a. Maybe a
Nothing
}