{-# 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.Classroom.Courses.CourseWork.Create
(
CoursesCourseWorkCreateResource
, coursesCourseWorkCreate
, CoursesCourseWorkCreate
, ccwcXgafv
, ccwcUploadProtocol
, ccwcCourseId
, ccwcAccessToken
, ccwcUploadType
, ccwcPayload
, ccwcCallback
) where
import Network.Google.Classroom.Types
import Network.Google.Prelude
type CoursesCourseWorkCreateResource =
"v1" :>
"courses" :>
Capture "courseId" Text :>
"courseWork" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CourseWork :> Post '[JSON] CourseWork
data CoursesCourseWorkCreate = CoursesCourseWorkCreate'
{ _ccwcXgafv :: !(Maybe Xgafv)
, _ccwcUploadProtocol :: !(Maybe Text)
, _ccwcCourseId :: !Text
, _ccwcAccessToken :: !(Maybe Text)
, _ccwcUploadType :: !(Maybe Text)
, _ccwcPayload :: !CourseWork
, _ccwcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
coursesCourseWorkCreate
:: Text
-> CourseWork
-> CoursesCourseWorkCreate
coursesCourseWorkCreate pCcwcCourseId_ pCcwcPayload_ =
CoursesCourseWorkCreate'
{ _ccwcXgafv = Nothing
, _ccwcUploadProtocol = Nothing
, _ccwcCourseId = pCcwcCourseId_
, _ccwcAccessToken = Nothing
, _ccwcUploadType = Nothing
, _ccwcPayload = pCcwcPayload_
, _ccwcCallback = Nothing
}
ccwcXgafv :: Lens' CoursesCourseWorkCreate (Maybe Xgafv)
ccwcXgafv
= lens _ccwcXgafv (\ s a -> s{_ccwcXgafv = a})
ccwcUploadProtocol :: Lens' CoursesCourseWorkCreate (Maybe Text)
ccwcUploadProtocol
= lens _ccwcUploadProtocol
(\ s a -> s{_ccwcUploadProtocol = a})
ccwcCourseId :: Lens' CoursesCourseWorkCreate Text
ccwcCourseId
= lens _ccwcCourseId (\ s a -> s{_ccwcCourseId = a})
ccwcAccessToken :: Lens' CoursesCourseWorkCreate (Maybe Text)
ccwcAccessToken
= lens _ccwcAccessToken
(\ s a -> s{_ccwcAccessToken = a})
ccwcUploadType :: Lens' CoursesCourseWorkCreate (Maybe Text)
ccwcUploadType
= lens _ccwcUploadType
(\ s a -> s{_ccwcUploadType = a})
ccwcPayload :: Lens' CoursesCourseWorkCreate CourseWork
ccwcPayload
= lens _ccwcPayload (\ s a -> s{_ccwcPayload = a})
ccwcCallback :: Lens' CoursesCourseWorkCreate (Maybe Text)
ccwcCallback
= lens _ccwcCallback (\ s a -> s{_ccwcCallback = a})
instance GoogleRequest CoursesCourseWorkCreate where
type Rs CoursesCourseWorkCreate = CourseWork
type Scopes CoursesCourseWorkCreate =
'["https://www.googleapis.com/auth/classroom.coursework.students"]
requestClient CoursesCourseWorkCreate'{..}
= go _ccwcCourseId _ccwcXgafv _ccwcUploadProtocol
_ccwcAccessToken
_ccwcUploadType
_ccwcCallback
(Just AltJSON)
_ccwcPayload
classroomService
where go
= buildClient
(Proxy :: Proxy CoursesCourseWorkCreateResource)
mempty