{-# 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.GetContent
(
ProjectsGetContentResource
, projectsGetContent
, ProjectsGetContent
, pgcXgafv
, pgcUploadProtocol
, pgcAccessToken
, pgcUploadType
, pgcVersionNumber
, pgcScriptId
, pgcCallback
) where
import Network.Google.Prelude
import Network.Google.Script.Types
type ProjectsGetContentResource =
"v1" :>
"projects" :>
Capture "scriptId" Text :>
"content" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "versionNumber" (Textual Int32) :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] Content
data ProjectsGetContent = ProjectsGetContent'
{ _pgcXgafv :: !(Maybe Xgafv)
, _pgcUploadProtocol :: !(Maybe Text)
, _pgcAccessToken :: !(Maybe Text)
, _pgcUploadType :: !(Maybe Text)
, _pgcVersionNumber :: !(Maybe (Textual Int32))
, _pgcScriptId :: !Text
, _pgcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsGetContent
:: Text
-> ProjectsGetContent
projectsGetContent pPgcScriptId_ =
ProjectsGetContent'
{ _pgcXgafv = Nothing
, _pgcUploadProtocol = Nothing
, _pgcAccessToken = Nothing
, _pgcUploadType = Nothing
, _pgcVersionNumber = Nothing
, _pgcScriptId = pPgcScriptId_
, _pgcCallback = Nothing
}
pgcXgafv :: Lens' ProjectsGetContent (Maybe Xgafv)
pgcXgafv = lens _pgcXgafv (\ s a -> s{_pgcXgafv = a})
pgcUploadProtocol :: Lens' ProjectsGetContent (Maybe Text)
pgcUploadProtocol
= lens _pgcUploadProtocol
(\ s a -> s{_pgcUploadProtocol = a})
pgcAccessToken :: Lens' ProjectsGetContent (Maybe Text)
pgcAccessToken
= lens _pgcAccessToken
(\ s a -> s{_pgcAccessToken = a})
pgcUploadType :: Lens' ProjectsGetContent (Maybe Text)
pgcUploadType
= lens _pgcUploadType
(\ s a -> s{_pgcUploadType = a})
pgcVersionNumber :: Lens' ProjectsGetContent (Maybe Int32)
pgcVersionNumber
= lens _pgcVersionNumber
(\ s a -> s{_pgcVersionNumber = a})
. mapping _Coerce
pgcScriptId :: Lens' ProjectsGetContent Text
pgcScriptId
= lens _pgcScriptId (\ s a -> s{_pgcScriptId = a})
pgcCallback :: Lens' ProjectsGetContent (Maybe Text)
pgcCallback
= lens _pgcCallback (\ s a -> s{_pgcCallback = a})
instance GoogleRequest ProjectsGetContent where
type Rs ProjectsGetContent = Content
type Scopes ProjectsGetContent =
'["https://www.googleapis.com/auth/script.projects",
"https://www.googleapis.com/auth/script.projects.readonly"]
requestClient ProjectsGetContent'{..}
= go _pgcScriptId _pgcXgafv _pgcUploadProtocol
_pgcAccessToken
_pgcUploadType
_pgcVersionNumber
_pgcCallback
(Just AltJSON)
scriptService
where go
= buildClient
(Proxy :: Proxy ProjectsGetContentResource)
mempty