{-# 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.Surveys.Insert
(
SurveysInsertResource
, surveysInsert
, SurveysInsert
, siPayload
) where
import Network.Google.Prelude
import Network.Google.Surveys.Types
type SurveysInsertResource =
"surveys" :>
"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/surveys",
"https://www.googleapis.com/auth/userinfo.email"]
requestClient SurveysInsert'{..}
= go (Just AltJSON) _siPayload surveysService
where go
= buildClient (Proxy :: Proxy SurveysInsertResource)
mempty