{-# 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.Documents.AnalyzeSentiment
(
DocumentsAnalyzeSentimentResource
, documentsAnalyzeSentiment
, DocumentsAnalyzeSentiment
, dasXgafv
, dasUploadProtocol
, dasAccessToken
, dasUploadType
, dasPayload
, dasCallback
) where
import Network.Google.Language.Types
import Network.Google.Prelude
type DocumentsAnalyzeSentimentResource =
"v1" :>
"documents:analyzeSentiment" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AnalyzeSentimentRequest :>
Post '[JSON] AnalyzeSentimentResponse
data DocumentsAnalyzeSentiment = DocumentsAnalyzeSentiment'
{ _dasXgafv :: !(Maybe Xgafv)
, _dasUploadProtocol :: !(Maybe Text)
, _dasAccessToken :: !(Maybe Text)
, _dasUploadType :: !(Maybe Text)
, _dasPayload :: !AnalyzeSentimentRequest
, _dasCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
documentsAnalyzeSentiment
:: AnalyzeSentimentRequest
-> DocumentsAnalyzeSentiment
documentsAnalyzeSentiment pDasPayload_ =
DocumentsAnalyzeSentiment'
{ _dasXgafv = Nothing
, _dasUploadProtocol = Nothing
, _dasAccessToken = Nothing
, _dasUploadType = Nothing
, _dasPayload = pDasPayload_
, _dasCallback = Nothing
}
dasXgafv :: Lens' DocumentsAnalyzeSentiment (Maybe Xgafv)
dasXgafv = lens _dasXgafv (\ s a -> s{_dasXgafv = a})
dasUploadProtocol :: Lens' DocumentsAnalyzeSentiment (Maybe Text)
dasUploadProtocol
= lens _dasUploadProtocol
(\ s a -> s{_dasUploadProtocol = a})
dasAccessToken :: Lens' DocumentsAnalyzeSentiment (Maybe Text)
dasAccessToken
= lens _dasAccessToken
(\ s a -> s{_dasAccessToken = a})
dasUploadType :: Lens' DocumentsAnalyzeSentiment (Maybe Text)
dasUploadType
= lens _dasUploadType
(\ s a -> s{_dasUploadType = a})
dasPayload :: Lens' DocumentsAnalyzeSentiment AnalyzeSentimentRequest
dasPayload
= lens _dasPayload (\ s a -> s{_dasPayload = a})
dasCallback :: Lens' DocumentsAnalyzeSentiment (Maybe Text)
dasCallback
= lens _dasCallback (\ s a -> s{_dasCallback = a})
instance GoogleRequest DocumentsAnalyzeSentiment
where
type Rs DocumentsAnalyzeSentiment =
AnalyzeSentimentResponse
type Scopes DocumentsAnalyzeSentiment =
'["https://www.googleapis.com/auth/cloud-language",
"https://www.googleapis.com/auth/cloud-platform"]
requestClient DocumentsAnalyzeSentiment'{..}
= go _dasXgafv _dasUploadProtocol _dasAccessToken
_dasUploadType
_dasCallback
(Just AltJSON)
_dasPayload
languageService
where go
= buildClient
(Proxy :: Proxy DocumentsAnalyzeSentimentResource)
mempty