{-# 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.Create
(
CoursesCreateResource
, coursesCreate
, CoursesCreate
, ccXgafv
, ccUploadProtocol
, ccAccessToken
, ccUploadType
, ccPayload
, ccCallback
) where
import Network.Google.Classroom.Types
import Network.Google.Prelude
type CoursesCreateResource =
"v1" :>
"courses" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Course :> Post '[JSON] Course
data CoursesCreate = CoursesCreate'
{ _ccXgafv :: !(Maybe Xgafv)
, _ccUploadProtocol :: !(Maybe Text)
, _ccAccessToken :: !(Maybe Text)
, _ccUploadType :: !(Maybe Text)
, _ccPayload :: !Course
, _ccCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
coursesCreate
:: Course
-> CoursesCreate
coursesCreate pCcPayload_ =
CoursesCreate'
{ _ccXgafv = Nothing
, _ccUploadProtocol = Nothing
, _ccAccessToken = Nothing
, _ccUploadType = Nothing
, _ccPayload = pCcPayload_
, _ccCallback = Nothing
}
ccXgafv :: Lens' CoursesCreate (Maybe Xgafv)
ccXgafv = lens _ccXgafv (\ s a -> s{_ccXgafv = a})
ccUploadProtocol :: Lens' CoursesCreate (Maybe Text)
ccUploadProtocol
= lens _ccUploadProtocol
(\ s a -> s{_ccUploadProtocol = a})
ccAccessToken :: Lens' CoursesCreate (Maybe Text)
ccAccessToken
= lens _ccAccessToken
(\ s a -> s{_ccAccessToken = a})
ccUploadType :: Lens' CoursesCreate (Maybe Text)
ccUploadType
= lens _ccUploadType (\ s a -> s{_ccUploadType = a})
ccPayload :: Lens' CoursesCreate Course
ccPayload
= lens _ccPayload (\ s a -> s{_ccPayload = a})
ccCallback :: Lens' CoursesCreate (Maybe Text)
ccCallback
= lens _ccCallback (\ s a -> s{_ccCallback = a})
instance GoogleRequest CoursesCreate where
type Rs CoursesCreate = Course
type Scopes CoursesCreate =
'["https://www.googleapis.com/auth/classroom.courses"]
requestClient CoursesCreate'{..}
= go _ccXgafv _ccUploadProtocol _ccAccessToken
_ccUploadType
_ccCallback
(Just AltJSON)
_ccPayload
classroomService
where go
= buildClient (Proxy :: Proxy CoursesCreateResource)
mempty