{-# 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.ConsumerSurveys.Results.Get
(
ResultsGetResource
, resultsGet
, ResultsGet
, rgSurveyURLId
, rgPayload
) where
import Network.Google.ConsumerSurveys.Types
import Network.Google.Prelude
type ResultsGetResource =
"consumersurveys" :>
"v2" :>
"surveys" :>
Capture "surveyUrlId" Text :>
"results" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ResultsGetRequest :>
Get '[JSON] SurveyResults
:<|>
"consumersurveys" :>
"v2" :>
"surveys" :>
Capture "surveyUrlId" Text :>
"results" :>
QueryParam "alt" AltMedia :>
Get '[OctetStream] Stream
data ResultsGet = ResultsGet'
{ _rgSurveyURLId :: !Text
, _rgPayload :: !ResultsGetRequest
} deriving (Eq,Show,Data,Typeable,Generic)
resultsGet
:: Text
-> ResultsGetRequest
-> ResultsGet
resultsGet pRgSurveyURLId_ pRgPayload_ =
ResultsGet'
{ _rgSurveyURLId = pRgSurveyURLId_
, _rgPayload = pRgPayload_
}
rgSurveyURLId :: Lens' ResultsGet Text
rgSurveyURLId
= lens _rgSurveyURLId
(\ s a -> s{_rgSurveyURLId = a})
rgPayload :: Lens' ResultsGet ResultsGetRequest
rgPayload
= lens _rgPayload (\ s a -> s{_rgPayload = a})
instance GoogleRequest ResultsGet where
type Rs ResultsGet = SurveyResults
type Scopes ResultsGet =
'["https://www.googleapis.com/auth/consumersurveys",
"https://www.googleapis.com/auth/consumersurveys.readonly",
"https://www.googleapis.com/auth/userinfo.email"]
requestClient ResultsGet'{..}
= go _rgSurveyURLId (Just AltJSON) _rgPayload
consumerSurveysService
where go :<|> _
= buildClient (Proxy :: Proxy ResultsGetResource)
mempty
instance GoogleRequest (MediaDownload ResultsGet)
where
type Rs (MediaDownload ResultsGet) = Stream
type Scopes (MediaDownload ResultsGet) =
Scopes ResultsGet
requestClient (MediaDownload ResultsGet'{..})
= go _rgSurveyURLId (Just AltMedia)
consumerSurveysService
where _ :<|> go
= buildClient (Proxy :: Proxy ResultsGetResource)
mempty