{-# 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.Script.Projects.Create
(
ProjectsCreateResource
, projectsCreate
, ProjectsCreate
, pcXgafv
, pcUploadProtocol
, pcAccessToken
, pcUploadType
, pcPayload
, pcCallback
) where
import Network.Google.Prelude
import Network.Google.Script.Types
type ProjectsCreateResource =
"v1" :>
"projects" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreateProjectRequest :>
Post '[JSON] Project
data ProjectsCreate = ProjectsCreate'
{ _pcXgafv :: !(Maybe Xgafv)
, _pcUploadProtocol :: !(Maybe Text)
, _pcAccessToken :: !(Maybe Text)
, _pcUploadType :: !(Maybe Text)
, _pcPayload :: !CreateProjectRequest
, _pcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsCreate
:: CreateProjectRequest
-> ProjectsCreate
projectsCreate pPcPayload_ =
ProjectsCreate'
{ _pcXgafv = Nothing
, _pcUploadProtocol = Nothing
, _pcAccessToken = Nothing
, _pcUploadType = Nothing
, _pcPayload = pPcPayload_
, _pcCallback = Nothing
}
pcXgafv :: Lens' ProjectsCreate (Maybe Xgafv)
pcXgafv = lens _pcXgafv (\ s a -> s{_pcXgafv = a})
pcUploadProtocol :: Lens' ProjectsCreate (Maybe Text)
pcUploadProtocol
= lens _pcUploadProtocol
(\ s a -> s{_pcUploadProtocol = a})
pcAccessToken :: Lens' ProjectsCreate (Maybe Text)
pcAccessToken
= lens _pcAccessToken
(\ s a -> s{_pcAccessToken = a})
pcUploadType :: Lens' ProjectsCreate (Maybe Text)
pcUploadType
= lens _pcUploadType (\ s a -> s{_pcUploadType = a})
pcPayload :: Lens' ProjectsCreate CreateProjectRequest
pcPayload
= lens _pcPayload (\ s a -> s{_pcPayload = a})
pcCallback :: Lens' ProjectsCreate (Maybe Text)
pcCallback
= lens _pcCallback (\ s a -> s{_pcCallback = a})
instance GoogleRequest ProjectsCreate where
type Rs ProjectsCreate = Project
type Scopes ProjectsCreate =
'["https://www.googleapis.com/auth/script.projects"]
requestClient ProjectsCreate'{..}
= go _pcXgafv _pcUploadProtocol _pcAccessToken
_pcUploadType
_pcCallback
(Just AltJSON)
_pcPayload
scriptService
where go
= buildClient (Proxy :: Proxy ProjectsCreateResource)
mempty