{-# 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.Surveys.Start
(
SurveysStartResource
, surveysStart
, SurveysStart
, ssResourceId
, ssPayload
) where
import Network.Google.ConsumerSurveys.Types
import Network.Google.Prelude
type SurveysStartResource =
"consumersurveys" :>
"v2" :>
"surveys" :>
Capture "resourceId" Text :>
"start" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SurveysStartRequest :>
Post '[JSON] SurveysStartResponse
data SurveysStart = SurveysStart'
{ _ssResourceId :: !Text
, _ssPayload :: !SurveysStartRequest
} deriving (Eq,Show,Data,Typeable,Generic)
surveysStart
:: Text
-> SurveysStartRequest
-> SurveysStart
surveysStart pSsResourceId_ pSsPayload_ =
SurveysStart'
{ _ssResourceId = pSsResourceId_
, _ssPayload = pSsPayload_
}
ssResourceId :: Lens' SurveysStart Text
ssResourceId
= lens _ssResourceId (\ s a -> s{_ssResourceId = a})
ssPayload :: Lens' SurveysStart SurveysStartRequest
ssPayload
= lens _ssPayload (\ s a -> s{_ssPayload = a})
instance GoogleRequest SurveysStart where
type Rs SurveysStart = SurveysStartResponse
type Scopes SurveysStart =
'["https://www.googleapis.com/auth/consumersurveys",
"https://www.googleapis.com/auth/userinfo.email"]
requestClient SurveysStart'{..}
= go _ssResourceId (Just AltJSON) _ssPayload
consumerSurveysService
where go
= buildClient (Proxy :: Proxy SurveysStartResource)
mempty