{-# 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.Update
(
CoursesUpdateResource
, coursesUpdate
, CoursesUpdate
, cuXgafv
, cuUploadProtocol
, cuAccessToken
, cuUploadType
, cuPayload
, cuId
, cuCallback
) where
import Network.Google.Classroom.Types
import Network.Google.Prelude
type CoursesUpdateResource =
"v1" :>
"courses" :>
Capture "id" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Course :> Put '[JSON] Course
data CoursesUpdate = CoursesUpdate'
{ _cuXgafv :: !(Maybe Xgafv)
, _cuUploadProtocol :: !(Maybe Text)
, _cuAccessToken :: !(Maybe Text)
, _cuUploadType :: !(Maybe Text)
, _cuPayload :: !Course
, _cuId :: !Text
, _cuCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
coursesUpdate
:: Course
-> Text
-> CoursesUpdate
coursesUpdate pCuPayload_ pCuId_ =
CoursesUpdate'
{ _cuXgafv = Nothing
, _cuUploadProtocol = Nothing
, _cuAccessToken = Nothing
, _cuUploadType = Nothing
, _cuPayload = pCuPayload_
, _cuId = pCuId_
, _cuCallback = Nothing
}
cuXgafv :: Lens' CoursesUpdate (Maybe Xgafv)
cuXgafv = lens _cuXgafv (\ s a -> s{_cuXgafv = a})
cuUploadProtocol :: Lens' CoursesUpdate (Maybe Text)
cuUploadProtocol
= lens _cuUploadProtocol
(\ s a -> s{_cuUploadProtocol = a})
cuAccessToken :: Lens' CoursesUpdate (Maybe Text)
cuAccessToken
= lens _cuAccessToken
(\ s a -> s{_cuAccessToken = a})
cuUploadType :: Lens' CoursesUpdate (Maybe Text)
cuUploadType
= lens _cuUploadType (\ s a -> s{_cuUploadType = a})
cuPayload :: Lens' CoursesUpdate Course
cuPayload
= lens _cuPayload (\ s a -> s{_cuPayload = a})
cuId :: Lens' CoursesUpdate Text
cuId = lens _cuId (\ s a -> s{_cuId = a})
cuCallback :: Lens' CoursesUpdate (Maybe Text)
cuCallback
= lens _cuCallback (\ s a -> s{_cuCallback = a})
instance GoogleRequest CoursesUpdate where
type Rs CoursesUpdate = Course
type Scopes CoursesUpdate =
'["https://www.googleapis.com/auth/classroom.courses"]
requestClient CoursesUpdate'{..}
= go _cuId _cuXgafv _cuUploadProtocol _cuAccessToken
_cuUploadType
_cuCallback
(Just AltJSON)
_cuPayload
classroomService
where go
= buildClient (Proxy :: Proxy CoursesUpdateResource)
mempty