{-# 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.Detections.Detect
(
DetectionsDetectResource
, detectionsDetect
, DetectionsDetect
, ddXgafv
, ddUploadProtocol
, ddPp
, ddAccessToken
, ddUploadType
, ddPayload
, ddBearerToken
, ddCallback
) where
import Network.Google.Prelude
import Network.Google.Translate.Types
type DetectionsDetectResource =
"language" :>
"translate" :>
"v2" :>
"detect" :>
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] DetectLanguageRequest :>
Post '[JSON] DetectionsListResponse
data DetectionsDetect = DetectionsDetect'
{ _ddXgafv :: !(Maybe Xgafv)
, _ddUploadProtocol :: !(Maybe Text)
, _ddPp :: !Bool
, _ddAccessToken :: !(Maybe Text)
, _ddUploadType :: !(Maybe Text)
, _ddPayload :: !DetectLanguageRequest
, _ddBearerToken :: !(Maybe Text)
, _ddCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
detectionsDetect
:: DetectLanguageRequest
-> DetectionsDetect
detectionsDetect pDdPayload_ =
DetectionsDetect'
{ _ddXgafv = Nothing
, _ddUploadProtocol = Nothing
, _ddPp = True
, _ddAccessToken = Nothing
, _ddUploadType = Nothing
, _ddPayload = pDdPayload_
, _ddBearerToken = Nothing
, _ddCallback = Nothing
}
ddXgafv :: Lens' DetectionsDetect (Maybe Xgafv)
ddXgafv = lens _ddXgafv (\ s a -> s{_ddXgafv = a})
ddUploadProtocol :: Lens' DetectionsDetect (Maybe Text)
ddUploadProtocol
= lens _ddUploadProtocol
(\ s a -> s{_ddUploadProtocol = a})
ddPp :: Lens' DetectionsDetect Bool
ddPp = lens _ddPp (\ s a -> s{_ddPp = a})
ddAccessToken :: Lens' DetectionsDetect (Maybe Text)
ddAccessToken
= lens _ddAccessToken
(\ s a -> s{_ddAccessToken = a})
ddUploadType :: Lens' DetectionsDetect (Maybe Text)
ddUploadType
= lens _ddUploadType (\ s a -> s{_ddUploadType = a})
ddPayload :: Lens' DetectionsDetect DetectLanguageRequest
ddPayload
= lens _ddPayload (\ s a -> s{_ddPayload = a})
ddBearerToken :: Lens' DetectionsDetect (Maybe Text)
ddBearerToken
= lens _ddBearerToken
(\ s a -> s{_ddBearerToken = a})
ddCallback :: Lens' DetectionsDetect (Maybe Text)
ddCallback
= lens _ddCallback (\ s a -> s{_ddCallback = a})
instance GoogleRequest DetectionsDetect where
type Rs DetectionsDetect = DetectionsListResponse
type Scopes DetectionsDetect =
'["https://www.googleapis.com/auth/cloud-translation",
"https://www.googleapis.com/auth/cloud-platform"]
requestClient DetectionsDetect'{..}
= go _ddXgafv _ddUploadProtocol (Just _ddPp)
_ddAccessToken
_ddUploadType
_ddBearerToken
_ddCallback
(Just AltJSON)
_ddPayload
translateService
where go
= buildClient
(Proxy :: Proxy DetectionsDetectResource)
mempty