{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Resource.Speech.Speech.Recognize
(
SpeechRecognizeResource
, speechRecognize
, SpeechRecognize
, srXgafv
, srUploadProtocol
, srAccessToken
, srUploadType
, srPayload
, srCallback
) where
import Network.Google.Prelude
import Network.Google.Speech.Types
type SpeechRecognizeResource =
"v1p1beta1" :>
"speech:recognize" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] RecognizeRequest :>
Post '[JSON] RecognizeResponse
data SpeechRecognize = SpeechRecognize'
{ _srXgafv :: !(Maybe Xgafv)
, _srUploadProtocol :: !(Maybe Text)
, _srAccessToken :: !(Maybe Text)
, _srUploadType :: !(Maybe Text)
, _srPayload :: !RecognizeRequest
, _srCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
speechRecognize
:: RecognizeRequest
-> SpeechRecognize
speechRecognize pSrPayload_ =
SpeechRecognize'
{ _srXgafv = Nothing
, _srUploadProtocol = Nothing
, _srAccessToken = Nothing
, _srUploadType = Nothing
, _srPayload = pSrPayload_
, _srCallback = Nothing
}
srXgafv :: Lens' SpeechRecognize (Maybe Xgafv)
srXgafv = lens _srXgafv (\ s a -> s{_srXgafv = a})
srUploadProtocol :: Lens' SpeechRecognize (Maybe Text)
srUploadProtocol
= lens _srUploadProtocol
(\ s a -> s{_srUploadProtocol = a})
srAccessToken :: Lens' SpeechRecognize (Maybe Text)
srAccessToken
= lens _srAccessToken
(\ s a -> s{_srAccessToken = a})
srUploadType :: Lens' SpeechRecognize (Maybe Text)
srUploadType
= lens _srUploadType (\ s a -> s{_srUploadType = a})
srPayload :: Lens' SpeechRecognize RecognizeRequest
srPayload
= lens _srPayload (\ s a -> s{_srPayload = a})
srCallback :: Lens' SpeechRecognize (Maybe Text)
srCallback
= lens _srCallback (\ s a -> s{_srCallback = a})
instance GoogleRequest SpeechRecognize where
type Rs SpeechRecognize = RecognizeResponse
type Scopes SpeechRecognize =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient SpeechRecognize'{..}
= go _srXgafv _srUploadProtocol _srAccessToken
_srUploadType
_srCallback
(Just AltJSON)
_srPayload
speechService
where go
= buildClient
(Proxy :: Proxy SpeechRecognizeResource)
mempty