{-# 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.Surveys.Results.Get
(
ResultsGetResource
, resultsGet
, ResultsGet
, rgSurveyURLId
, rgPayload
) where
import Network.Google.Prelude
import Network.Google.Surveys.Types
type ResultsGetResource =
"surveys" :>
"v2" :>
"surveys" :>
Capture "surveyUrlId" Text :>
"results" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ResultsGetRequest :>
Get '[JSON] SurveyResults
:<|>
"surveys" :>
"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/surveys",
"https://www.googleapis.com/auth/surveys.readonly",
"https://www.googleapis.com/auth/userinfo.email"]
requestClient ResultsGet'{..}
= go _rgSurveyURLId (Just AltJSON) _rgPayload
surveysService
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) surveysService
where _ :<|> go
= buildClient (Proxy :: Proxy ResultsGetResource)
mempty