{-# 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.List
(
TranslationsListResource
, translationsList
, TranslationsList
, tlXgafv
, tlUploadProtocol
, tlPp
, tlAccessToken
, tlFormat
, tlUploadType
, tlQ
, tlBearerToken
, tlModel
, tlSource
, tlCid
, tlTarget
, tlCallback
) where
import Network.Google.Prelude
import Network.Google.Translate.Types
type TranslationsListResource =
"language" :>
"translate" :>
"v2" :>
QueryParams "q" Text :>
QueryParam "target" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "pp" Bool :>
QueryParam "access_token" Text :>
QueryParam "format" TranslationsListFormat :>
QueryParam "uploadType" Text :>
QueryParam "bearer_token" Text :>
QueryParam "model" Text :>
QueryParam "source" Text :>
QueryParams "cid" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON] TranslationsListResponse
data TranslationsList = TranslationsList'
{ _tlXgafv :: !(Maybe Xgafv)
, _tlUploadProtocol :: !(Maybe Text)
, _tlPp :: !Bool
, _tlAccessToken :: !(Maybe Text)
, _tlFormat :: !(Maybe TranslationsListFormat)
, _tlUploadType :: !(Maybe Text)
, _tlQ :: ![Text]
, _tlBearerToken :: !(Maybe Text)
, _tlModel :: !(Maybe Text)
, _tlSource :: !(Maybe Text)
, _tlCid :: !(Maybe [Text])
, _tlTarget :: !Text
, _tlCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
translationsList
:: [Text]
-> Text
-> TranslationsList
translationsList pTlQ_ pTlTarget_ =
TranslationsList'
{ _tlXgafv = Nothing
, _tlUploadProtocol = Nothing
, _tlPp = True
, _tlAccessToken = Nothing
, _tlFormat = Nothing
, _tlUploadType = Nothing
, _tlQ = _Coerce # pTlQ_
, _tlBearerToken = Nothing
, _tlModel = Nothing
, _tlSource = Nothing
, _tlCid = Nothing
, _tlTarget = pTlTarget_
, _tlCallback = Nothing
}
tlXgafv :: Lens' TranslationsList (Maybe Xgafv)
tlXgafv = lens _tlXgafv (\ s a -> s{_tlXgafv = a})
tlUploadProtocol :: Lens' TranslationsList (Maybe Text)
tlUploadProtocol
= lens _tlUploadProtocol
(\ s a -> s{_tlUploadProtocol = a})
tlPp :: Lens' TranslationsList Bool
tlPp = lens _tlPp (\ s a -> s{_tlPp = a})
tlAccessToken :: Lens' TranslationsList (Maybe Text)
tlAccessToken
= lens _tlAccessToken
(\ s a -> s{_tlAccessToken = a})
tlFormat :: Lens' TranslationsList (Maybe TranslationsListFormat)
tlFormat = lens _tlFormat (\ s a -> s{_tlFormat = a})
tlUploadType :: Lens' TranslationsList (Maybe Text)
tlUploadType
= lens _tlUploadType (\ s a -> s{_tlUploadType = a})
tlQ :: Lens' TranslationsList [Text]
tlQ = lens _tlQ (\ s a -> s{_tlQ = a}) . _Coerce
tlBearerToken :: Lens' TranslationsList (Maybe Text)
tlBearerToken
= lens _tlBearerToken
(\ s a -> s{_tlBearerToken = a})
tlModel :: Lens' TranslationsList (Maybe Text)
tlModel = lens _tlModel (\ s a -> s{_tlModel = a})
tlSource :: Lens' TranslationsList (Maybe Text)
tlSource = lens _tlSource (\ s a -> s{_tlSource = a})
tlCid :: Lens' TranslationsList [Text]
tlCid
= lens _tlCid (\ s a -> s{_tlCid = a}) . _Default .
_Coerce
tlTarget :: Lens' TranslationsList Text
tlTarget = lens _tlTarget (\ s a -> s{_tlTarget = a})
tlCallback :: Lens' TranslationsList (Maybe Text)
tlCallback
= lens _tlCallback (\ s a -> s{_tlCallback = a})
instance GoogleRequest TranslationsList where
type Rs TranslationsList = TranslationsListResponse
type Scopes TranslationsList =
'["https://www.googleapis.com/auth/cloud-translation",
"https://www.googleapis.com/auth/cloud-platform"]
requestClient TranslationsList'{..}
= go _tlQ (Just _tlTarget) _tlXgafv _tlUploadProtocol
(Just _tlPp)
_tlAccessToken
_tlFormat
_tlUploadType
_tlBearerToken
_tlModel
_tlSource
(_tlCid ^. _Default)
_tlCallback
(Just AltJSON)
translateService
where go
= buildClient
(Proxy :: Proxy TranslationsListResource)
mempty