{-# 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.Announcements.Create
(
CoursesAnnouncementsCreateResource
, coursesAnnouncementsCreate
, CoursesAnnouncementsCreate
, couXgafv
, couUploadProtocol
, couCourseId
, couAccessToken
, couUploadType
, couPayload
, couCallback
) where
import Network.Google.Classroom.Types
import Network.Google.Prelude
type CoursesAnnouncementsCreateResource =
"v1" :>
"courses" :>
Capture "courseId" Text :>
"announcements" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Announcement :>
Post '[JSON] Announcement
data CoursesAnnouncementsCreate = CoursesAnnouncementsCreate'
{ _couXgafv :: !(Maybe Xgafv)
, _couUploadProtocol :: !(Maybe Text)
, _couCourseId :: !Text
, _couAccessToken :: !(Maybe Text)
, _couUploadType :: !(Maybe Text)
, _couPayload :: !Announcement
, _couCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
coursesAnnouncementsCreate
:: Text
-> Announcement
-> CoursesAnnouncementsCreate
coursesAnnouncementsCreate pCouCourseId_ pCouPayload_ =
CoursesAnnouncementsCreate'
{ _couXgafv = Nothing
, _couUploadProtocol = Nothing
, _couCourseId = pCouCourseId_
, _couAccessToken = Nothing
, _couUploadType = Nothing
, _couPayload = pCouPayload_
, _couCallback = Nothing
}
couXgafv :: Lens' CoursesAnnouncementsCreate (Maybe Xgafv)
couXgafv = lens _couXgafv (\ s a -> s{_couXgafv = a})
couUploadProtocol :: Lens' CoursesAnnouncementsCreate (Maybe Text)
couUploadProtocol
= lens _couUploadProtocol
(\ s a -> s{_couUploadProtocol = a})
couCourseId :: Lens' CoursesAnnouncementsCreate Text
couCourseId
= lens _couCourseId (\ s a -> s{_couCourseId = a})
couAccessToken :: Lens' CoursesAnnouncementsCreate (Maybe Text)
couAccessToken
= lens _couAccessToken
(\ s a -> s{_couAccessToken = a})
couUploadType :: Lens' CoursesAnnouncementsCreate (Maybe Text)
couUploadType
= lens _couUploadType
(\ s a -> s{_couUploadType = a})
couPayload :: Lens' CoursesAnnouncementsCreate Announcement
couPayload
= lens _couPayload (\ s a -> s{_couPayload = a})
couCallback :: Lens' CoursesAnnouncementsCreate (Maybe Text)
couCallback
= lens _couCallback (\ s a -> s{_couCallback = a})
instance GoogleRequest CoursesAnnouncementsCreate
where
type Rs CoursesAnnouncementsCreate = Announcement
type Scopes CoursesAnnouncementsCreate =
'["https://www.googleapis.com/auth/classroom.announcements"]
requestClient CoursesAnnouncementsCreate'{..}
= go _couCourseId _couXgafv _couUploadProtocol
_couAccessToken
_couUploadType
_couCallback
(Just AltJSON)
_couPayload
classroomService
where go
= buildClient
(Proxy :: Proxy CoursesAnnouncementsCreateResource)
mempty