{-# 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.Patch
(
CoursesPatchResource
, coursesPatch
, CoursesPatch
, cpXgafv
, cpUploadProtocol
, cpUpdateMask
, cpAccessToken
, cpUploadType
, cpPayload
, cpId
, cpCallback
) where
import Network.Google.Classroom.Types
import Network.Google.Prelude
type CoursesPatchResource =
"v1" :>
"courses" :>
Capture "id" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "updateMask" GFieldMask :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Course :> Patch '[JSON] Course
data CoursesPatch = CoursesPatch'
{ _cpXgafv :: !(Maybe Xgafv)
, _cpUploadProtocol :: !(Maybe Text)
, _cpUpdateMask :: !(Maybe GFieldMask)
, _cpAccessToken :: !(Maybe Text)
, _cpUploadType :: !(Maybe Text)
, _cpPayload :: !Course
, _cpId :: !Text
, _cpCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
coursesPatch
:: Course
-> Text
-> CoursesPatch
coursesPatch pCpPayload_ pCpId_ =
CoursesPatch'
{ _cpXgafv = Nothing
, _cpUploadProtocol = Nothing
, _cpUpdateMask = Nothing
, _cpAccessToken = Nothing
, _cpUploadType = Nothing
, _cpPayload = pCpPayload_
, _cpId = pCpId_
, _cpCallback = Nothing
}
cpXgafv :: Lens' CoursesPatch (Maybe Xgafv)
cpXgafv = lens _cpXgafv (\ s a -> s{_cpXgafv = a})
cpUploadProtocol :: Lens' CoursesPatch (Maybe Text)
cpUploadProtocol
= lens _cpUploadProtocol
(\ s a -> s{_cpUploadProtocol = a})
cpUpdateMask :: Lens' CoursesPatch (Maybe GFieldMask)
cpUpdateMask
= lens _cpUpdateMask (\ s a -> s{_cpUpdateMask = a})
cpAccessToken :: Lens' CoursesPatch (Maybe Text)
cpAccessToken
= lens _cpAccessToken
(\ s a -> s{_cpAccessToken = a})
cpUploadType :: Lens' CoursesPatch (Maybe Text)
cpUploadType
= lens _cpUploadType (\ s a -> s{_cpUploadType = a})
cpPayload :: Lens' CoursesPatch Course
cpPayload
= lens _cpPayload (\ s a -> s{_cpPayload = a})
cpId :: Lens' CoursesPatch Text
cpId = lens _cpId (\ s a -> s{_cpId = a})
cpCallback :: Lens' CoursesPatch (Maybe Text)
cpCallback
= lens _cpCallback (\ s a -> s{_cpCallback = a})
instance GoogleRequest CoursesPatch where
type Rs CoursesPatch = Course
type Scopes CoursesPatch =
'["https://www.googleapis.com/auth/classroom.courses"]
requestClient CoursesPatch'{..}
= go _cpId _cpXgafv _cpUploadProtocol _cpUpdateMask
_cpAccessToken
_cpUploadType
_cpCallback
(Just AltJSON)
_cpPayload
classroomService
where go
= buildClient (Proxy :: Proxy CoursesPatchResource)
mempty