{-# 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.Language.Translations.Translate
(
TranslationsTranslateResource
, translationsTranslate
, TranslationsTranslate
, ttXgafv
, ttUploadProtocol
, ttPp
, ttAccessToken
, ttUploadType
, ttPayload
, ttBearerToken
, ttCallback
) where
import Network.Google.Prelude
import Network.Google.Translate.Types
type TranslationsTranslateResource =
"language" :>
"translate" :>
"v2" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "pp" Bool :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "bearer_token" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TranslateTextRequest :>
Post '[JSON] TranslationsListResponse
data TranslationsTranslate = TranslationsTranslate'
{ _ttXgafv :: !(Maybe Xgafv)
, _ttUploadProtocol :: !(Maybe Text)
, _ttPp :: !Bool
, _ttAccessToken :: !(Maybe Text)
, _ttUploadType :: !(Maybe Text)
, _ttPayload :: !TranslateTextRequest
, _ttBearerToken :: !(Maybe Text)
, _ttCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
translationsTranslate
:: TranslateTextRequest
-> TranslationsTranslate
translationsTranslate pTtPayload_ =
TranslationsTranslate'
{ _ttXgafv = Nothing
, _ttUploadProtocol = Nothing
, _ttPp = True
, _ttAccessToken = Nothing
, _ttUploadType = Nothing
, _ttPayload = pTtPayload_
, _ttBearerToken = Nothing
, _ttCallback = Nothing
}
ttXgafv :: Lens' TranslationsTranslate (Maybe Xgafv)
ttXgafv = lens _ttXgafv (\ s a -> s{_ttXgafv = a})
ttUploadProtocol :: Lens' TranslationsTranslate (Maybe Text)
ttUploadProtocol
= lens _ttUploadProtocol
(\ s a -> s{_ttUploadProtocol = a})
ttPp :: Lens' TranslationsTranslate Bool
ttPp = lens _ttPp (\ s a -> s{_ttPp = a})
ttAccessToken :: Lens' TranslationsTranslate (Maybe Text)
ttAccessToken
= lens _ttAccessToken
(\ s a -> s{_ttAccessToken = a})
ttUploadType :: Lens' TranslationsTranslate (Maybe Text)
ttUploadType
= lens _ttUploadType (\ s a -> s{_ttUploadType = a})
ttPayload :: Lens' TranslationsTranslate TranslateTextRequest
ttPayload
= lens _ttPayload (\ s a -> s{_ttPayload = a})
ttBearerToken :: Lens' TranslationsTranslate (Maybe Text)
ttBearerToken
= lens _ttBearerToken
(\ s a -> s{_ttBearerToken = a})
ttCallback :: Lens' TranslationsTranslate (Maybe Text)
ttCallback
= lens _ttCallback (\ s a -> s{_ttCallback = a})
instance GoogleRequest TranslationsTranslate where
type Rs TranslationsTranslate =
TranslationsListResponse
type Scopes TranslationsTranslate =
'["https://www.googleapis.com/auth/cloud-translation",
"https://www.googleapis.com/auth/cloud-platform"]
requestClient TranslationsTranslate'{..}
= go _ttXgafv _ttUploadProtocol (Just _ttPp)
_ttAccessToken
_ttUploadType
_ttBearerToken
_ttCallback
(Just AltJSON)
_ttPayload
translateService
where go
= buildClient
(Proxy :: Proxy TranslationsTranslateResource)
mempty