{-# 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.Update
(
SurveysUpdateResource
, surveysUpdate
, SurveysUpdate
, suSurveyURLId
, suPayload
) where
import Network.Google.ConsumerSurveys.Types
import Network.Google.Prelude
type SurveysUpdateResource =
"consumersurveys" :>
"v2" :>
"surveys" :>
Capture "surveyUrlId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Survey :> Put '[JSON] Survey
data SurveysUpdate = SurveysUpdate'
{ _suSurveyURLId :: !Text
, _suPayload :: !Survey
} deriving (Eq,Show,Data,Typeable,Generic)
surveysUpdate
:: Text
-> Survey
-> SurveysUpdate
surveysUpdate pSuSurveyURLId_ pSuPayload_ =
SurveysUpdate'
{ _suSurveyURLId = pSuSurveyURLId_
, _suPayload = pSuPayload_
}
suSurveyURLId :: Lens' SurveysUpdate Text
suSurveyURLId
= lens _suSurveyURLId
(\ s a -> s{_suSurveyURLId = a})
suPayload :: Lens' SurveysUpdate Survey
suPayload
= lens _suPayload (\ s a -> s{_suPayload = a})
instance GoogleRequest SurveysUpdate where
type Rs SurveysUpdate = Survey
type Scopes SurveysUpdate =
'["https://www.googleapis.com/auth/consumersurveys",
"https://www.googleapis.com/auth/userinfo.email"]
requestClient SurveysUpdate'{..}
= go _suSurveyURLId (Just AltJSON) _suPayload
consumerSurveysService
where go
= buildClient (Proxy :: Proxy SurveysUpdateResource)
mempty