{-# 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.Students.Create
(
CoursesStudentsCreateResource
, coursesStudentsCreate
, CoursesStudentsCreate
, cscXgafv
, cscUploadProtocol
, cscCourseId
, cscAccessToken
, cscUploadType
, cscPayload
, cscEnrollmentCode
, cscCallback
) where
import Network.Google.Classroom.Types
import Network.Google.Prelude
type CoursesStudentsCreateResource =
"v1" :>
"courses" :>
Capture "courseId" Text :>
"students" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "enrollmentCode" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Student :> Post '[JSON] Student
data CoursesStudentsCreate = CoursesStudentsCreate'
{ _cscXgafv :: !(Maybe Xgafv)
, _cscUploadProtocol :: !(Maybe Text)
, _cscCourseId :: !Text
, _cscAccessToken :: !(Maybe Text)
, _cscUploadType :: !(Maybe Text)
, _cscPayload :: !Student
, _cscEnrollmentCode :: !(Maybe Text)
, _cscCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
coursesStudentsCreate
:: Text
-> Student
-> CoursesStudentsCreate
coursesStudentsCreate pCscCourseId_ pCscPayload_ =
CoursesStudentsCreate'
{ _cscXgafv = Nothing
, _cscUploadProtocol = Nothing
, _cscCourseId = pCscCourseId_
, _cscAccessToken = Nothing
, _cscUploadType = Nothing
, _cscPayload = pCscPayload_
, _cscEnrollmentCode = Nothing
, _cscCallback = Nothing
}
cscXgafv :: Lens' CoursesStudentsCreate (Maybe Xgafv)
cscXgafv = lens _cscXgafv (\ s a -> s{_cscXgafv = a})
cscUploadProtocol :: Lens' CoursesStudentsCreate (Maybe Text)
cscUploadProtocol
= lens _cscUploadProtocol
(\ s a -> s{_cscUploadProtocol = a})
cscCourseId :: Lens' CoursesStudentsCreate Text
cscCourseId
= lens _cscCourseId (\ s a -> s{_cscCourseId = a})
cscAccessToken :: Lens' CoursesStudentsCreate (Maybe Text)
cscAccessToken
= lens _cscAccessToken
(\ s a -> s{_cscAccessToken = a})
cscUploadType :: Lens' CoursesStudentsCreate (Maybe Text)
cscUploadType
= lens _cscUploadType
(\ s a -> s{_cscUploadType = a})
cscPayload :: Lens' CoursesStudentsCreate Student
cscPayload
= lens _cscPayload (\ s a -> s{_cscPayload = a})
cscEnrollmentCode :: Lens' CoursesStudentsCreate (Maybe Text)
cscEnrollmentCode
= lens _cscEnrollmentCode
(\ s a -> s{_cscEnrollmentCode = a})
cscCallback :: Lens' CoursesStudentsCreate (Maybe Text)
cscCallback
= lens _cscCallback (\ s a -> s{_cscCallback = a})
instance GoogleRequest CoursesStudentsCreate where
type Rs CoursesStudentsCreate = Student
type Scopes CoursesStudentsCreate =
'["https://www.googleapis.com/auth/classroom.profile.emails",
"https://www.googleapis.com/auth/classroom.profile.photos",
"https://www.googleapis.com/auth/classroom.rosters"]
requestClient CoursesStudentsCreate'{..}
= go _cscCourseId _cscXgafv _cscUploadProtocol
_cscAccessToken
_cscUploadType
_cscEnrollmentCode
_cscCallback
(Just AltJSON)
_cscPayload
classroomService
where go
= buildClient
(Proxy :: Proxy CoursesStudentsCreateResource)
mempty