{-# 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.Drive.Comments.Create
(
CommentsCreateResource
, commentsCreate
, CommentsCreate
, ccPayload
, ccFileId
) where
import Network.Google.Drive.Types
import Network.Google.Prelude
type CommentsCreateResource =
"drive" :>
"v3" :>
"files" :>
Capture "fileId" Text :>
"comments" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Comment :> Post '[JSON] Comment
data CommentsCreate = CommentsCreate'
{ _ccPayload :: !Comment
, _ccFileId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
commentsCreate
:: Comment
-> Text
-> CommentsCreate
commentsCreate pCcPayload_ pCcFileId_ =
CommentsCreate'
{ _ccPayload = pCcPayload_
, _ccFileId = pCcFileId_
}
ccPayload :: Lens' CommentsCreate Comment
ccPayload
= lens _ccPayload (\ s a -> s{_ccPayload = a})
ccFileId :: Lens' CommentsCreate Text
ccFileId = lens _ccFileId (\ s a -> s{_ccFileId = a})
instance GoogleRequest CommentsCreate where
type Rs CommentsCreate = Comment
type Scopes CommentsCreate =
'["https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.file"]
requestClient CommentsCreate'{..}
= go _ccFileId (Just AltJSON) _ccPayload driveService
where go
= buildClient (Proxy :: Proxy CommentsCreateResource)
mempty