{-# 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.Insert
(
SurveysInsertResource
, surveysInsert
, SurveysInsert
, siPayload
) where
import Network.Google.ConsumerSurveys.Types
import Network.Google.Prelude
type SurveysInsertResource =
"consumersurveys" :>
"v2" :>
"surveys" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Survey :> Post '[JSON] Survey
newtype SurveysInsert = SurveysInsert'
{ _siPayload :: Survey
} deriving (Eq,Show,Data,Typeable,Generic)
surveysInsert
:: Survey
-> SurveysInsert
surveysInsert pSiPayload_ =
SurveysInsert'
{ _siPayload = pSiPayload_
}
siPayload :: Lens' SurveysInsert Survey
siPayload
= lens _siPayload (\ s a -> s{_siPayload = a})
instance GoogleRequest SurveysInsert where
type Rs SurveysInsert = Survey
type Scopes SurveysInsert =
'["https://www.googleapis.com/auth/consumersurveys",
"https://www.googleapis.com/auth/userinfo.email"]
requestClient SurveysInsert'{..}
= go (Just AltJSON) _siPayload consumerSurveysService
where go
= buildClient (Proxy :: Proxy SurveysInsertResource)
mempty