module Network.Google.Classroom.Types.Product where
import Network.Google.Classroom.Types.Sum
import Network.Google.Prelude
data ListCourseAliasesResponse = ListCourseAliasesResponse'
{ _lcarNextPageToken :: !(Maybe Text)
, _lcarAliases :: !(Maybe [CourseAlias])
} deriving (Eq,Show,Data,Typeable,Generic)
listCourseAliasesResponse
:: ListCourseAliasesResponse
listCourseAliasesResponse =
ListCourseAliasesResponse'
{ _lcarNextPageToken = Nothing
, _lcarAliases = Nothing
}
lcarNextPageToken :: Lens' ListCourseAliasesResponse (Maybe Text)
lcarNextPageToken
= lens _lcarNextPageToken
(\ s a -> s{_lcarNextPageToken = a})
lcarAliases :: Lens' ListCourseAliasesResponse [CourseAlias]
lcarAliases
= lens _lcarAliases (\ s a -> s{_lcarAliases = a}) .
_Default
. _Coerce
instance FromJSON ListCourseAliasesResponse where
parseJSON
= withObject "ListCourseAliasesResponse"
(\ o ->
ListCourseAliasesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "aliases" .!= mempty))
instance ToJSON ListCourseAliasesResponse where
toJSON ListCourseAliasesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lcarNextPageToken,
("aliases" .=) <$> _lcarAliases])
data CourseWork = CourseWork'
{ _cwCreationTime :: !(Maybe Text)
, _cwState :: !(Maybe Text)
, _cwMaterials :: !(Maybe [Material])
, _cwCourseId :: !(Maybe Text)
, _cwMaxPoints :: !(Maybe (Textual Double))
, _cwWorkType :: !(Maybe Text)
, _cwDueTime :: !(Maybe TimeOfDay')
, _cwAssociatedWithDeveloper :: !(Maybe Bool)
, _cwUpdateTime :: !(Maybe Text)
, _cwMultipleChoiceQuestion :: !(Maybe MultipleChoiceQuestion)
, _cwId :: !(Maybe Text)
, _cwSubmissionModificationMode :: !(Maybe Text)
, _cwDueDate :: !(Maybe Date)
, _cwTitle :: !(Maybe Text)
, _cwAlternateLink :: !(Maybe Text)
, _cwAssignment :: !(Maybe Assignment)
, _cwDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
courseWork
:: CourseWork
courseWork =
CourseWork'
{ _cwCreationTime = Nothing
, _cwState = Nothing
, _cwMaterials = Nothing
, _cwCourseId = Nothing
, _cwMaxPoints = Nothing
, _cwWorkType = Nothing
, _cwDueTime = Nothing
, _cwAssociatedWithDeveloper = Nothing
, _cwUpdateTime = Nothing
, _cwMultipleChoiceQuestion = Nothing
, _cwId = Nothing
, _cwSubmissionModificationMode = Nothing
, _cwDueDate = Nothing
, _cwTitle = Nothing
, _cwAlternateLink = Nothing
, _cwAssignment = Nothing
, _cwDescription = Nothing
}
cwCreationTime :: Lens' CourseWork (Maybe Text)
cwCreationTime
= lens _cwCreationTime
(\ s a -> s{_cwCreationTime = a})
cwState :: Lens' CourseWork (Maybe Text)
cwState = lens _cwState (\ s a -> s{_cwState = a})
cwMaterials :: Lens' CourseWork [Material]
cwMaterials
= lens _cwMaterials (\ s a -> s{_cwMaterials = a}) .
_Default
. _Coerce
cwCourseId :: Lens' CourseWork (Maybe Text)
cwCourseId
= lens _cwCourseId (\ s a -> s{_cwCourseId = a})
cwMaxPoints :: Lens' CourseWork (Maybe Double)
cwMaxPoints
= lens _cwMaxPoints (\ s a -> s{_cwMaxPoints = a}) .
mapping _Coerce
cwWorkType :: Lens' CourseWork (Maybe Text)
cwWorkType
= lens _cwWorkType (\ s a -> s{_cwWorkType = a})
cwDueTime :: Lens' CourseWork (Maybe TimeOfDay')
cwDueTime
= lens _cwDueTime (\ s a -> s{_cwDueTime = a})
cwAssociatedWithDeveloper :: Lens' CourseWork (Maybe Bool)
cwAssociatedWithDeveloper
= lens _cwAssociatedWithDeveloper
(\ s a -> s{_cwAssociatedWithDeveloper = a})
cwUpdateTime :: Lens' CourseWork (Maybe Text)
cwUpdateTime
= lens _cwUpdateTime (\ s a -> s{_cwUpdateTime = a})
cwMultipleChoiceQuestion :: Lens' CourseWork (Maybe MultipleChoiceQuestion)
cwMultipleChoiceQuestion
= lens _cwMultipleChoiceQuestion
(\ s a -> s{_cwMultipleChoiceQuestion = a})
cwId :: Lens' CourseWork (Maybe Text)
cwId = lens _cwId (\ s a -> s{_cwId = a})
cwSubmissionModificationMode :: Lens' CourseWork (Maybe Text)
cwSubmissionModificationMode
= lens _cwSubmissionModificationMode
(\ s a -> s{_cwSubmissionModificationMode = a})
cwDueDate :: Lens' CourseWork (Maybe Date)
cwDueDate
= lens _cwDueDate (\ s a -> s{_cwDueDate = a})
cwTitle :: Lens' CourseWork (Maybe Text)
cwTitle = lens _cwTitle (\ s a -> s{_cwTitle = a})
cwAlternateLink :: Lens' CourseWork (Maybe Text)
cwAlternateLink
= lens _cwAlternateLink
(\ s a -> s{_cwAlternateLink = a})
cwAssignment :: Lens' CourseWork (Maybe Assignment)
cwAssignment
= lens _cwAssignment (\ s a -> s{_cwAssignment = a})
cwDescription :: Lens' CourseWork (Maybe Text)
cwDescription
= lens _cwDescription
(\ s a -> s{_cwDescription = a})
instance FromJSON CourseWork where
parseJSON
= withObject "CourseWork"
(\ o ->
CourseWork' <$>
(o .:? "creationTime") <*> (o .:? "state") <*>
(o .:? "materials" .!= mempty)
<*> (o .:? "courseId")
<*> (o .:? "maxPoints")
<*> (o .:? "workType")
<*> (o .:? "dueTime")
<*> (o .:? "associatedWithDeveloper")
<*> (o .:? "updateTime")
<*> (o .:? "multipleChoiceQuestion")
<*> (o .:? "id")
<*> (o .:? "submissionModificationMode")
<*> (o .:? "dueDate")
<*> (o .:? "title")
<*> (o .:? "alternateLink")
<*> (o .:? "assignment")
<*> (o .:? "description"))
instance ToJSON CourseWork where
toJSON CourseWork'{..}
= object
(catMaybes
[("creationTime" .=) <$> _cwCreationTime,
("state" .=) <$> _cwState,
("materials" .=) <$> _cwMaterials,
("courseId" .=) <$> _cwCourseId,
("maxPoints" .=) <$> _cwMaxPoints,
("workType" .=) <$> _cwWorkType,
("dueTime" .=) <$> _cwDueTime,
("associatedWithDeveloper" .=) <$>
_cwAssociatedWithDeveloper,
("updateTime" .=) <$> _cwUpdateTime,
("multipleChoiceQuestion" .=) <$>
_cwMultipleChoiceQuestion,
("id" .=) <$> _cwId,
("submissionModificationMode" .=) <$>
_cwSubmissionModificationMode,
("dueDate" .=) <$> _cwDueDate,
("title" .=) <$> _cwTitle,
("alternateLink" .=) <$> _cwAlternateLink,
("assignment" .=) <$> _cwAssignment,
("description" .=) <$> _cwDescription])
data DriveFile = DriveFile'
{ _dfThumbnailURL :: !(Maybe Text)
, _dfId :: !(Maybe Text)
, _dfTitle :: !(Maybe Text)
, _dfAlternateLink :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
driveFile
:: DriveFile
driveFile =
DriveFile'
{ _dfThumbnailURL = Nothing
, _dfId = Nothing
, _dfTitle = Nothing
, _dfAlternateLink = Nothing
}
dfThumbnailURL :: Lens' DriveFile (Maybe Text)
dfThumbnailURL
= lens _dfThumbnailURL
(\ s a -> s{_dfThumbnailURL = a})
dfId :: Lens' DriveFile (Maybe Text)
dfId = lens _dfId (\ s a -> s{_dfId = a})
dfTitle :: Lens' DriveFile (Maybe Text)
dfTitle = lens _dfTitle (\ s a -> s{_dfTitle = a})
dfAlternateLink :: Lens' DriveFile (Maybe Text)
dfAlternateLink
= lens _dfAlternateLink
(\ s a -> s{_dfAlternateLink = a})
instance FromJSON DriveFile where
parseJSON
= withObject "DriveFile"
(\ o ->
DriveFile' <$>
(o .:? "thumbnailUrl") <*> (o .:? "id") <*>
(o .:? "title")
<*> (o .:? "alternateLink"))
instance ToJSON DriveFile where
toJSON DriveFile'{..}
= object
(catMaybes
[("thumbnailUrl" .=) <$> _dfThumbnailURL,
("id" .=) <$> _dfId, ("title" .=) <$> _dfTitle,
("alternateLink" .=) <$> _dfAlternateLink])
data GuardianInvitation = GuardianInvitation'
{ _giCreationTime :: !(Maybe Text)
, _giStudentId :: !(Maybe Text)
, _giState :: !(Maybe Text)
, _giInvitationId :: !(Maybe Text)
, _giInvitedEmailAddress :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
guardianInvitation
:: GuardianInvitation
guardianInvitation =
GuardianInvitation'
{ _giCreationTime = Nothing
, _giStudentId = Nothing
, _giState = Nothing
, _giInvitationId = Nothing
, _giInvitedEmailAddress = Nothing
}
giCreationTime :: Lens' GuardianInvitation (Maybe Text)
giCreationTime
= lens _giCreationTime
(\ s a -> s{_giCreationTime = a})
giStudentId :: Lens' GuardianInvitation (Maybe Text)
giStudentId
= lens _giStudentId (\ s a -> s{_giStudentId = a})
giState :: Lens' GuardianInvitation (Maybe Text)
giState = lens _giState (\ s a -> s{_giState = a})
giInvitationId :: Lens' GuardianInvitation (Maybe Text)
giInvitationId
= lens _giInvitationId
(\ s a -> s{_giInvitationId = a})
giInvitedEmailAddress :: Lens' GuardianInvitation (Maybe Text)
giInvitedEmailAddress
= lens _giInvitedEmailAddress
(\ s a -> s{_giInvitedEmailAddress = a})
instance FromJSON GuardianInvitation where
parseJSON
= withObject "GuardianInvitation"
(\ o ->
GuardianInvitation' <$>
(o .:? "creationTime") <*> (o .:? "studentId") <*>
(o .:? "state")
<*> (o .:? "invitationId")
<*> (o .:? "invitedEmailAddress"))
instance ToJSON GuardianInvitation where
toJSON GuardianInvitation'{..}
= object
(catMaybes
[("creationTime" .=) <$> _giCreationTime,
("studentId" .=) <$> _giStudentId,
("state" .=) <$> _giState,
("invitationId" .=) <$> _giInvitationId,
("invitedEmailAddress" .=) <$>
_giInvitedEmailAddress])
data ReturnStudentSubmissionRequest =
ReturnStudentSubmissionRequest'
deriving (Eq,Show,Data,Typeable,Generic)
returnStudentSubmissionRequest
:: ReturnStudentSubmissionRequest
returnStudentSubmissionRequest = ReturnStudentSubmissionRequest'
instance FromJSON ReturnStudentSubmissionRequest
where
parseJSON
= withObject "ReturnStudentSubmissionRequest"
(\ o -> pure ReturnStudentSubmissionRequest')
instance ToJSON ReturnStudentSubmissionRequest where
toJSON = const emptyObject
data ReclaimStudentSubmissionRequest =
ReclaimStudentSubmissionRequest'
deriving (Eq,Show,Data,Typeable,Generic)
reclaimStudentSubmissionRequest
:: ReclaimStudentSubmissionRequest
reclaimStudentSubmissionRequest = ReclaimStudentSubmissionRequest'
instance FromJSON ReclaimStudentSubmissionRequest
where
parseJSON
= withObject "ReclaimStudentSubmissionRequest"
(\ o -> pure ReclaimStudentSubmissionRequest')
instance ToJSON ReclaimStudentSubmissionRequest where
toJSON = const emptyObject
data ListCourseWorkResponse = ListCourseWorkResponse'
{ _lcwrCourseWork :: !(Maybe [CourseWork])
, _lcwrNextPageToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
listCourseWorkResponse
:: ListCourseWorkResponse
listCourseWorkResponse =
ListCourseWorkResponse'
{ _lcwrCourseWork = Nothing
, _lcwrNextPageToken = Nothing
}
lcwrCourseWork :: Lens' ListCourseWorkResponse [CourseWork]
lcwrCourseWork
= lens _lcwrCourseWork
(\ s a -> s{_lcwrCourseWork = a})
. _Default
. _Coerce
lcwrNextPageToken :: Lens' ListCourseWorkResponse (Maybe Text)
lcwrNextPageToken
= lens _lcwrNextPageToken
(\ s a -> s{_lcwrNextPageToken = a})
instance FromJSON ListCourseWorkResponse where
parseJSON
= withObject "ListCourseWorkResponse"
(\ o ->
ListCourseWorkResponse' <$>
(o .:? "courseWork" .!= mempty) <*>
(o .:? "nextPageToken"))
instance ToJSON ListCourseWorkResponse where
toJSON ListCourseWorkResponse'{..}
= object
(catMaybes
[("courseWork" .=) <$> _lcwrCourseWork,
("nextPageToken" .=) <$> _lcwrNextPageToken])
data Empty =
Empty'
deriving (Eq,Show,Data,Typeable,Generic)
empty
:: Empty
empty = Empty'
instance FromJSON Empty where
parseJSON = withObject "Empty" (\ o -> pure Empty')
instance ToJSON Empty where
toJSON = const emptyObject
newtype GlobalPermission = GlobalPermission'
{ _gpPermission :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
globalPermission
:: GlobalPermission
globalPermission =
GlobalPermission'
{ _gpPermission = Nothing
}
gpPermission :: Lens' GlobalPermission (Maybe Text)
gpPermission
= lens _gpPermission (\ s a -> s{_gpPermission = a})
instance FromJSON GlobalPermission where
parseJSON
= withObject "GlobalPermission"
(\ o -> GlobalPermission' <$> (o .:? "permission"))
instance ToJSON GlobalPermission where
toJSON GlobalPermission'{..}
= object
(catMaybes [("permission" .=) <$> _gpPermission])
data Link = Link'
{ _lThumbnailURL :: !(Maybe Text)
, _lURL :: !(Maybe Text)
, _lTitle :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
link
:: Link
link =
Link'
{ _lThumbnailURL = Nothing
, _lURL = Nothing
, _lTitle = Nothing
}
lThumbnailURL :: Lens' Link (Maybe Text)
lThumbnailURL
= lens _lThumbnailURL
(\ s a -> s{_lThumbnailURL = a})
lURL :: Lens' Link (Maybe Text)
lURL = lens _lURL (\ s a -> s{_lURL = a})
lTitle :: Lens' Link (Maybe Text)
lTitle = lens _lTitle (\ s a -> s{_lTitle = a})
instance FromJSON Link where
parseJSON
= withObject "Link"
(\ o ->
Link' <$>
(o .:? "thumbnailUrl") <*> (o .:? "url") <*>
(o .:? "title"))
instance ToJSON Link where
toJSON Link'{..}
= object
(catMaybes
[("thumbnailUrl" .=) <$> _lThumbnailURL,
("url" .=) <$> _lURL, ("title" .=) <$> _lTitle])
newtype AssignmentSubmission = AssignmentSubmission'
{ _asAttachments :: Maybe [Attachment]
} deriving (Eq,Show,Data,Typeable,Generic)
assignmentSubmission
:: AssignmentSubmission
assignmentSubmission =
AssignmentSubmission'
{ _asAttachments = Nothing
}
asAttachments :: Lens' AssignmentSubmission [Attachment]
asAttachments
= lens _asAttachments
(\ s a -> s{_asAttachments = a})
. _Default
. _Coerce
instance FromJSON AssignmentSubmission where
parseJSON
= withObject "AssignmentSubmission"
(\ o ->
AssignmentSubmission' <$>
(o .:? "attachments" .!= mempty))
instance ToJSON AssignmentSubmission where
toJSON AssignmentSubmission'{..}
= object
(catMaybes [("attachments" .=) <$> _asAttachments])
newtype ModifyAttachmentsRequest = ModifyAttachmentsRequest'
{ _marAddAttachments :: Maybe [Attachment]
} deriving (Eq,Show,Data,Typeable,Generic)
modifyAttachmentsRequest
:: ModifyAttachmentsRequest
modifyAttachmentsRequest =
ModifyAttachmentsRequest'
{ _marAddAttachments = Nothing
}
marAddAttachments :: Lens' ModifyAttachmentsRequest [Attachment]
marAddAttachments
= lens _marAddAttachments
(\ s a -> s{_marAddAttachments = a})
. _Default
. _Coerce
instance FromJSON ModifyAttachmentsRequest where
parseJSON
= withObject "ModifyAttachmentsRequest"
(\ o ->
ModifyAttachmentsRequest' <$>
(o .:? "addAttachments" .!= mempty))
instance ToJSON ModifyAttachmentsRequest where
toJSON ModifyAttachmentsRequest'{..}
= object
(catMaybes
[("addAttachments" .=) <$> _marAddAttachments])
data ListStudentSubmissionsResponse = ListStudentSubmissionsResponse'
{ _lssrNextPageToken :: !(Maybe Text)
, _lssrStudentSubmissions :: !(Maybe [StudentSubmission])
} deriving (Eq,Show,Data,Typeable,Generic)
listStudentSubmissionsResponse
:: ListStudentSubmissionsResponse
listStudentSubmissionsResponse =
ListStudentSubmissionsResponse'
{ _lssrNextPageToken = Nothing
, _lssrStudentSubmissions = Nothing
}
lssrNextPageToken :: Lens' ListStudentSubmissionsResponse (Maybe Text)
lssrNextPageToken
= lens _lssrNextPageToken
(\ s a -> s{_lssrNextPageToken = a})
lssrStudentSubmissions :: Lens' ListStudentSubmissionsResponse [StudentSubmission]
lssrStudentSubmissions
= lens _lssrStudentSubmissions
(\ s a -> s{_lssrStudentSubmissions = a})
. _Default
. _Coerce
instance FromJSON ListStudentSubmissionsResponse
where
parseJSON
= withObject "ListStudentSubmissionsResponse"
(\ o ->
ListStudentSubmissionsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "studentSubmissions" .!= mempty))
instance ToJSON ListStudentSubmissionsResponse where
toJSON ListStudentSubmissionsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lssrNextPageToken,
("studentSubmissions" .=) <$>
_lssrStudentSubmissions])
data Material = Material'
{ _mDriveFile :: !(Maybe SharedDriveFile)
, _mLink :: !(Maybe Link)
, _mYouTubeVideo :: !(Maybe YouTubeVideo)
, _mForm :: !(Maybe Form)
} deriving (Eq,Show,Data,Typeable,Generic)
material
:: Material
material =
Material'
{ _mDriveFile = Nothing
, _mLink = Nothing
, _mYouTubeVideo = Nothing
, _mForm = Nothing
}
mDriveFile :: Lens' Material (Maybe SharedDriveFile)
mDriveFile
= lens _mDriveFile (\ s a -> s{_mDriveFile = a})
mLink :: Lens' Material (Maybe Link)
mLink = lens _mLink (\ s a -> s{_mLink = a})
mYouTubeVideo :: Lens' Material (Maybe YouTubeVideo)
mYouTubeVideo
= lens _mYouTubeVideo
(\ s a -> s{_mYouTubeVideo = a})
mForm :: Lens' Material (Maybe Form)
mForm = lens _mForm (\ s a -> s{_mForm = a})
instance FromJSON Material where
parseJSON
= withObject "Material"
(\ o ->
Material' <$>
(o .:? "driveFile") <*> (o .:? "link") <*>
(o .:? "youtubeVideo")
<*> (o .:? "form"))
instance ToJSON Material where
toJSON Material'{..}
= object
(catMaybes
[("driveFile" .=) <$> _mDriveFile,
("link" .=) <$> _mLink,
("youtubeVideo" .=) <$> _mYouTubeVideo,
("form" .=) <$> _mForm])
newtype MultipleChoiceSubmission = MultipleChoiceSubmission'
{ _mcsAnswer :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
multipleChoiceSubmission
:: MultipleChoiceSubmission
multipleChoiceSubmission =
MultipleChoiceSubmission'
{ _mcsAnswer = Nothing
}
mcsAnswer :: Lens' MultipleChoiceSubmission (Maybe Text)
mcsAnswer
= lens _mcsAnswer (\ s a -> s{_mcsAnswer = a})
instance FromJSON MultipleChoiceSubmission where
parseJSON
= withObject "MultipleChoiceSubmission"
(\ o ->
MultipleChoiceSubmission' <$> (o .:? "answer"))
instance ToJSON MultipleChoiceSubmission where
toJSON MultipleChoiceSubmission'{..}
= object (catMaybes [("answer" .=) <$> _mcsAnswer])
data ListInvitationsResponse = ListInvitationsResponse'
{ _lirNextPageToken :: !(Maybe Text)
, _lirInvitations :: !(Maybe [Invitation])
} deriving (Eq,Show,Data,Typeable,Generic)
listInvitationsResponse
:: ListInvitationsResponse
listInvitationsResponse =
ListInvitationsResponse'
{ _lirNextPageToken = Nothing
, _lirInvitations = Nothing
}
lirNextPageToken :: Lens' ListInvitationsResponse (Maybe Text)
lirNextPageToken
= lens _lirNextPageToken
(\ s a -> s{_lirNextPageToken = a})
lirInvitations :: Lens' ListInvitationsResponse [Invitation]
lirInvitations
= lens _lirInvitations
(\ s a -> s{_lirInvitations = a})
. _Default
. _Coerce
instance FromJSON ListInvitationsResponse where
parseJSON
= withObject "ListInvitationsResponse"
(\ o ->
ListInvitationsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "invitations" .!= mempty))
instance ToJSON ListInvitationsResponse where
toJSON ListInvitationsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lirNextPageToken,
("invitations" .=) <$> _lirInvitations])
data Guardian = Guardian'
{ _gStudentId :: !(Maybe Text)
, _gGuardianId :: !(Maybe Text)
, _gInvitedEmailAddress :: !(Maybe Text)
, _gGuardianProFile :: !(Maybe UserProFile)
} deriving (Eq,Show,Data,Typeable,Generic)
guardian
:: Guardian
guardian =
Guardian'
{ _gStudentId = Nothing
, _gGuardianId = Nothing
, _gInvitedEmailAddress = Nothing
, _gGuardianProFile = Nothing
}
gStudentId :: Lens' Guardian (Maybe Text)
gStudentId
= lens _gStudentId (\ s a -> s{_gStudentId = a})
gGuardianId :: Lens' Guardian (Maybe Text)
gGuardianId
= lens _gGuardianId (\ s a -> s{_gGuardianId = a})
gInvitedEmailAddress :: Lens' Guardian (Maybe Text)
gInvitedEmailAddress
= lens _gInvitedEmailAddress
(\ s a -> s{_gInvitedEmailAddress = a})
gGuardianProFile :: Lens' Guardian (Maybe UserProFile)
gGuardianProFile
= lens _gGuardianProFile
(\ s a -> s{_gGuardianProFile = a})
instance FromJSON Guardian where
parseJSON
= withObject "Guardian"
(\ o ->
Guardian' <$>
(o .:? "studentId") <*> (o .:? "guardianId") <*>
(o .:? "invitedEmailAddress")
<*> (o .:? "guardianProfile"))
instance ToJSON Guardian where
toJSON Guardian'{..}
= object
(catMaybes
[("studentId" .=) <$> _gStudentId,
("guardianId" .=) <$> _gGuardianId,
("invitedEmailAddress" .=) <$> _gInvitedEmailAddress,
("guardianProfile" .=) <$> _gGuardianProFile])
data CourseMaterial = CourseMaterial'
{ _cmDriveFile :: !(Maybe DriveFile)
, _cmLink :: !(Maybe Link)
, _cmYouTubeVideo :: !(Maybe YouTubeVideo)
, _cmForm :: !(Maybe Form)
} deriving (Eq,Show,Data,Typeable,Generic)
courseMaterial
:: CourseMaterial
courseMaterial =
CourseMaterial'
{ _cmDriveFile = Nothing
, _cmLink = Nothing
, _cmYouTubeVideo = Nothing
, _cmForm = Nothing
}
cmDriveFile :: Lens' CourseMaterial (Maybe DriveFile)
cmDriveFile
= lens _cmDriveFile (\ s a -> s{_cmDriveFile = a})
cmLink :: Lens' CourseMaterial (Maybe Link)
cmLink = lens _cmLink (\ s a -> s{_cmLink = a})
cmYouTubeVideo :: Lens' CourseMaterial (Maybe YouTubeVideo)
cmYouTubeVideo
= lens _cmYouTubeVideo
(\ s a -> s{_cmYouTubeVideo = a})
cmForm :: Lens' CourseMaterial (Maybe Form)
cmForm = lens _cmForm (\ s a -> s{_cmForm = a})
instance FromJSON CourseMaterial where
parseJSON
= withObject "CourseMaterial"
(\ o ->
CourseMaterial' <$>
(o .:? "driveFile") <*> (o .:? "link") <*>
(o .:? "youTubeVideo")
<*> (o .:? "form"))
instance ToJSON CourseMaterial where
toJSON CourseMaterial'{..}
= object
(catMaybes
[("driveFile" .=) <$> _cmDriveFile,
("link" .=) <$> _cmLink,
("youTubeVideo" .=) <$> _cmYouTubeVideo,
("form" .=) <$> _cmForm])
newtype ShortAnswerSubmission = ShortAnswerSubmission'
{ _sasAnswer :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
shortAnswerSubmission
:: ShortAnswerSubmission
shortAnswerSubmission =
ShortAnswerSubmission'
{ _sasAnswer = Nothing
}
sasAnswer :: Lens' ShortAnswerSubmission (Maybe Text)
sasAnswer
= lens _sasAnswer (\ s a -> s{_sasAnswer = a})
instance FromJSON ShortAnswerSubmission where
parseJSON
= withObject "ShortAnswerSubmission"
(\ o -> ShortAnswerSubmission' <$> (o .:? "answer"))
instance ToJSON ShortAnswerSubmission where
toJSON ShortAnswerSubmission'{..}
= object (catMaybes [("answer" .=) <$> _sasAnswer])
data Invitation = Invitation'
{ _iCourseId :: !(Maybe Text)
, _iUserId :: !(Maybe Text)
, _iRole :: !(Maybe Text)
, _iId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
invitation
:: Invitation
invitation =
Invitation'
{ _iCourseId = Nothing
, _iUserId = Nothing
, _iRole = Nothing
, _iId = Nothing
}
iCourseId :: Lens' Invitation (Maybe Text)
iCourseId
= lens _iCourseId (\ s a -> s{_iCourseId = a})
iUserId :: Lens' Invitation (Maybe Text)
iUserId = lens _iUserId (\ s a -> s{_iUserId = a})
iRole :: Lens' Invitation (Maybe Text)
iRole = lens _iRole (\ s a -> s{_iRole = a})
iId :: Lens' Invitation (Maybe Text)
iId = lens _iId (\ s a -> s{_iId = a})
instance FromJSON Invitation where
parseJSON
= withObject "Invitation"
(\ o ->
Invitation' <$>
(o .:? "courseId") <*> (o .:? "userId") <*>
(o .:? "role")
<*> (o .:? "id"))
instance ToJSON Invitation where
toJSON Invitation'{..}
= object
(catMaybes
[("courseId" .=) <$> _iCourseId,
("userId" .=) <$> _iUserId, ("role" .=) <$> _iRole,
("id" .=) <$> _iId])
data Attachment = Attachment'
{ _aDriveFile :: !(Maybe DriveFile)
, _aLink :: !(Maybe Link)
, _aYouTubeVideo :: !(Maybe YouTubeVideo)
, _aForm :: !(Maybe Form)
} deriving (Eq,Show,Data,Typeable,Generic)
attachment
:: Attachment
attachment =
Attachment'
{ _aDriveFile = Nothing
, _aLink = Nothing
, _aYouTubeVideo = Nothing
, _aForm = Nothing
}
aDriveFile :: Lens' Attachment (Maybe DriveFile)
aDriveFile
= lens _aDriveFile (\ s a -> s{_aDriveFile = a})
aLink :: Lens' Attachment (Maybe Link)
aLink = lens _aLink (\ s a -> s{_aLink = a})
aYouTubeVideo :: Lens' Attachment (Maybe YouTubeVideo)
aYouTubeVideo
= lens _aYouTubeVideo
(\ s a -> s{_aYouTubeVideo = a})
aForm :: Lens' Attachment (Maybe Form)
aForm = lens _aForm (\ s a -> s{_aForm = a})
instance FromJSON Attachment where
parseJSON
= withObject "Attachment"
(\ o ->
Attachment' <$>
(o .:? "driveFile") <*> (o .:? "link") <*>
(o .:? "youTubeVideo")
<*> (o .:? "form"))
instance ToJSON Attachment where
toJSON Attachment'{..}
= object
(catMaybes
[("driveFile" .=) <$> _aDriveFile,
("link" .=) <$> _aLink,
("youTubeVideo" .=) <$> _aYouTubeVideo,
("form" .=) <$> _aForm])
data StudentSubmission = StudentSubmission'
{ _ssCreationTime :: !(Maybe Text)
, _ssLate :: !(Maybe Bool)
, _ssState :: !(Maybe Text)
, _ssCourseId :: !(Maybe Text)
, _ssMultipleChoiceSubmission :: !(Maybe MultipleChoiceSubmission)
, _ssAssignmentSubmission :: !(Maybe AssignmentSubmission)
, _ssShortAnswerSubmission :: !(Maybe ShortAnswerSubmission)
, _ssAssociatedWithDeveloper :: !(Maybe Bool)
, _ssUserId :: !(Maybe Text)
, _ssUpdateTime :: !(Maybe Text)
, _ssCourseWorkType :: !(Maybe Text)
, _ssAssignedGrade :: !(Maybe (Textual Double))
, _ssId :: !(Maybe Text)
, _ssDraftGrade :: !(Maybe (Textual Double))
, _ssAlternateLink :: !(Maybe Text)
, _ssCourseWorkId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
studentSubmission
:: StudentSubmission
studentSubmission =
StudentSubmission'
{ _ssCreationTime = Nothing
, _ssLate = Nothing
, _ssState = Nothing
, _ssCourseId = Nothing
, _ssMultipleChoiceSubmission = Nothing
, _ssAssignmentSubmission = Nothing
, _ssShortAnswerSubmission = Nothing
, _ssAssociatedWithDeveloper = Nothing
, _ssUserId = Nothing
, _ssUpdateTime = Nothing
, _ssCourseWorkType = Nothing
, _ssAssignedGrade = Nothing
, _ssId = Nothing
, _ssDraftGrade = Nothing
, _ssAlternateLink = Nothing
, _ssCourseWorkId = Nothing
}
ssCreationTime :: Lens' StudentSubmission (Maybe Text)
ssCreationTime
= lens _ssCreationTime
(\ s a -> s{_ssCreationTime = a})
ssLate :: Lens' StudentSubmission (Maybe Bool)
ssLate = lens _ssLate (\ s a -> s{_ssLate = a})
ssState :: Lens' StudentSubmission (Maybe Text)
ssState = lens _ssState (\ s a -> s{_ssState = a})
ssCourseId :: Lens' StudentSubmission (Maybe Text)
ssCourseId
= lens _ssCourseId (\ s a -> s{_ssCourseId = a})
ssMultipleChoiceSubmission :: Lens' StudentSubmission (Maybe MultipleChoiceSubmission)
ssMultipleChoiceSubmission
= lens _ssMultipleChoiceSubmission
(\ s a -> s{_ssMultipleChoiceSubmission = a})
ssAssignmentSubmission :: Lens' StudentSubmission (Maybe AssignmentSubmission)
ssAssignmentSubmission
= lens _ssAssignmentSubmission
(\ s a -> s{_ssAssignmentSubmission = a})
ssShortAnswerSubmission :: Lens' StudentSubmission (Maybe ShortAnswerSubmission)
ssShortAnswerSubmission
= lens _ssShortAnswerSubmission
(\ s a -> s{_ssShortAnswerSubmission = a})
ssAssociatedWithDeveloper :: Lens' StudentSubmission (Maybe Bool)
ssAssociatedWithDeveloper
= lens _ssAssociatedWithDeveloper
(\ s a -> s{_ssAssociatedWithDeveloper = a})
ssUserId :: Lens' StudentSubmission (Maybe Text)
ssUserId = lens _ssUserId (\ s a -> s{_ssUserId = a})
ssUpdateTime :: Lens' StudentSubmission (Maybe Text)
ssUpdateTime
= lens _ssUpdateTime (\ s a -> s{_ssUpdateTime = a})
ssCourseWorkType :: Lens' StudentSubmission (Maybe Text)
ssCourseWorkType
= lens _ssCourseWorkType
(\ s a -> s{_ssCourseWorkType = a})
ssAssignedGrade :: Lens' StudentSubmission (Maybe Double)
ssAssignedGrade
= lens _ssAssignedGrade
(\ s a -> s{_ssAssignedGrade = a})
. mapping _Coerce
ssId :: Lens' StudentSubmission (Maybe Text)
ssId = lens _ssId (\ s a -> s{_ssId = a})
ssDraftGrade :: Lens' StudentSubmission (Maybe Double)
ssDraftGrade
= lens _ssDraftGrade (\ s a -> s{_ssDraftGrade = a})
. mapping _Coerce
ssAlternateLink :: Lens' StudentSubmission (Maybe Text)
ssAlternateLink
= lens _ssAlternateLink
(\ s a -> s{_ssAlternateLink = a})
ssCourseWorkId :: Lens' StudentSubmission (Maybe Text)
ssCourseWorkId
= lens _ssCourseWorkId
(\ s a -> s{_ssCourseWorkId = a})
instance FromJSON StudentSubmission where
parseJSON
= withObject "StudentSubmission"
(\ o ->
StudentSubmission' <$>
(o .:? "creationTime") <*> (o .:? "late") <*>
(o .:? "state")
<*> (o .:? "courseId")
<*> (o .:? "multipleChoiceSubmission")
<*> (o .:? "assignmentSubmission")
<*> (o .:? "shortAnswerSubmission")
<*> (o .:? "associatedWithDeveloper")
<*> (o .:? "userId")
<*> (o .:? "updateTime")
<*> (o .:? "courseWorkType")
<*> (o .:? "assignedGrade")
<*> (o .:? "id")
<*> (o .:? "draftGrade")
<*> (o .:? "alternateLink")
<*> (o .:? "courseWorkId"))
instance ToJSON StudentSubmission where
toJSON StudentSubmission'{..}
= object
(catMaybes
[("creationTime" .=) <$> _ssCreationTime,
("late" .=) <$> _ssLate, ("state" .=) <$> _ssState,
("courseId" .=) <$> _ssCourseId,
("multipleChoiceSubmission" .=) <$>
_ssMultipleChoiceSubmission,
("assignmentSubmission" .=) <$>
_ssAssignmentSubmission,
("shortAnswerSubmission" .=) <$>
_ssShortAnswerSubmission,
("associatedWithDeveloper" .=) <$>
_ssAssociatedWithDeveloper,
("userId" .=) <$> _ssUserId,
("updateTime" .=) <$> _ssUpdateTime,
("courseWorkType" .=) <$> _ssCourseWorkType,
("assignedGrade" .=) <$> _ssAssignedGrade,
("id" .=) <$> _ssId,
("draftGrade" .=) <$> _ssDraftGrade,
("alternateLink" .=) <$> _ssAlternateLink,
("courseWorkId" .=) <$> _ssCourseWorkId])
data ListGuardiansResponse = ListGuardiansResponse'
{ _lgrNextPageToken :: !(Maybe Text)
, _lgrGuardians :: !(Maybe [Guardian])
} deriving (Eq,Show,Data,Typeable,Generic)
listGuardiansResponse
:: ListGuardiansResponse
listGuardiansResponse =
ListGuardiansResponse'
{ _lgrNextPageToken = Nothing
, _lgrGuardians = Nothing
}
lgrNextPageToken :: Lens' ListGuardiansResponse (Maybe Text)
lgrNextPageToken
= lens _lgrNextPageToken
(\ s a -> s{_lgrNextPageToken = a})
lgrGuardians :: Lens' ListGuardiansResponse [Guardian]
lgrGuardians
= lens _lgrGuardians (\ s a -> s{_lgrGuardians = a})
. _Default
. _Coerce
instance FromJSON ListGuardiansResponse where
parseJSON
= withObject "ListGuardiansResponse"
(\ o ->
ListGuardiansResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "guardians" .!= mempty))
instance ToJSON ListGuardiansResponse where
toJSON ListGuardiansResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lgrNextPageToken,
("guardians" .=) <$> _lgrGuardians])
data Date = Date'
{ _dDay :: !(Maybe (Textual Int32))
, _dYear :: !(Maybe (Textual Int32))
, _dMonth :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
date
:: Date
date =
Date'
{ _dDay = Nothing
, _dYear = Nothing
, _dMonth = Nothing
}
dDay :: Lens' Date (Maybe Int32)
dDay
= lens _dDay (\ s a -> s{_dDay = a}) .
mapping _Coerce
dYear :: Lens' Date (Maybe Int32)
dYear
= lens _dYear (\ s a -> s{_dYear = a}) .
mapping _Coerce
dMonth :: Lens' Date (Maybe Int32)
dMonth
= lens _dMonth (\ s a -> s{_dMonth = a}) .
mapping _Coerce
instance FromJSON Date where
parseJSON
= withObject "Date"
(\ o ->
Date' <$>
(o .:? "day") <*> (o .:? "year") <*> (o .:? "month"))
instance ToJSON Date where
toJSON Date'{..}
= object
(catMaybes
[("day" .=) <$> _dDay, ("year" .=) <$> _dYear,
("month" .=) <$> _dMonth])
data YouTubeVideo = YouTubeVideo'
{ _ytvThumbnailURL :: !(Maybe Text)
, _ytvId :: !(Maybe Text)
, _ytvTitle :: !(Maybe Text)
, _ytvAlternateLink :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
youTubeVideo
:: YouTubeVideo
youTubeVideo =
YouTubeVideo'
{ _ytvThumbnailURL = Nothing
, _ytvId = Nothing
, _ytvTitle = Nothing
, _ytvAlternateLink = Nothing
}
ytvThumbnailURL :: Lens' YouTubeVideo (Maybe Text)
ytvThumbnailURL
= lens _ytvThumbnailURL
(\ s a -> s{_ytvThumbnailURL = a})
ytvId :: Lens' YouTubeVideo (Maybe Text)
ytvId = lens _ytvId (\ s a -> s{_ytvId = a})
ytvTitle :: Lens' YouTubeVideo (Maybe Text)
ytvTitle = lens _ytvTitle (\ s a -> s{_ytvTitle = a})
ytvAlternateLink :: Lens' YouTubeVideo (Maybe Text)
ytvAlternateLink
= lens _ytvAlternateLink
(\ s a -> s{_ytvAlternateLink = a})
instance FromJSON YouTubeVideo where
parseJSON
= withObject "YouTubeVideo"
(\ o ->
YouTubeVideo' <$>
(o .:? "thumbnailUrl") <*> (o .:? "id") <*>
(o .:? "title")
<*> (o .:? "alternateLink"))
instance ToJSON YouTubeVideo where
toJSON YouTubeVideo'{..}
= object
(catMaybes
[("thumbnailUrl" .=) <$> _ytvThumbnailURL,
("id" .=) <$> _ytvId, ("title" .=) <$> _ytvTitle,
("alternateLink" .=) <$> _ytvAlternateLink])
data Teacher = Teacher'
{ _tCourseId :: !(Maybe Text)
, _tProFile :: !(Maybe UserProFile)
, _tUserId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
teacher
:: Teacher
teacher =
Teacher'
{ _tCourseId = Nothing
, _tProFile = Nothing
, _tUserId = Nothing
}
tCourseId :: Lens' Teacher (Maybe Text)
tCourseId
= lens _tCourseId (\ s a -> s{_tCourseId = a})
tProFile :: Lens' Teacher (Maybe UserProFile)
tProFile = lens _tProFile (\ s a -> s{_tProFile = a})
tUserId :: Lens' Teacher (Maybe Text)
tUserId = lens _tUserId (\ s a -> s{_tUserId = a})
instance FromJSON Teacher where
parseJSON
= withObject "Teacher"
(\ o ->
Teacher' <$>
(o .:? "courseId") <*> (o .:? "profile") <*>
(o .:? "userId"))
instance ToJSON Teacher where
toJSON Teacher'{..}
= object
(catMaybes
[("courseId" .=) <$> _tCourseId,
("profile" .=) <$> _tProFile,
("userId" .=) <$> _tUserId])
data CourseMaterialSet = CourseMaterialSet'
{ _cmsMaterials :: !(Maybe [CourseMaterial])
, _cmsTitle :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
courseMaterialSet
:: CourseMaterialSet
courseMaterialSet =
CourseMaterialSet'
{ _cmsMaterials = Nothing
, _cmsTitle = Nothing
}
cmsMaterials :: Lens' CourseMaterialSet [CourseMaterial]
cmsMaterials
= lens _cmsMaterials (\ s a -> s{_cmsMaterials = a})
. _Default
. _Coerce
cmsTitle :: Lens' CourseMaterialSet (Maybe Text)
cmsTitle = lens _cmsTitle (\ s a -> s{_cmsTitle = a})
instance FromJSON CourseMaterialSet where
parseJSON
= withObject "CourseMaterialSet"
(\ o ->
CourseMaterialSet' <$>
(o .:? "materials" .!= mempty) <*> (o .:? "title"))
instance ToJSON CourseMaterialSet where
toJSON CourseMaterialSet'{..}
= object
(catMaybes
[("materials" .=) <$> _cmsMaterials,
("title" .=) <$> _cmsTitle])
data Name = Name'
{ _nGivenName :: !(Maybe Text)
, _nFullName :: !(Maybe Text)
, _nFamilyName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
name
:: Name
name =
Name'
{ _nGivenName = Nothing
, _nFullName = Nothing
, _nFamilyName = Nothing
}
nGivenName :: Lens' Name (Maybe Text)
nGivenName
= lens _nGivenName (\ s a -> s{_nGivenName = a})
nFullName :: Lens' Name (Maybe Text)
nFullName
= lens _nFullName (\ s a -> s{_nFullName = a})
nFamilyName :: Lens' Name (Maybe Text)
nFamilyName
= lens _nFamilyName (\ s a -> s{_nFamilyName = a})
instance FromJSON Name where
parseJSON
= withObject "Name"
(\ o ->
Name' <$>
(o .:? "givenName") <*> (o .:? "fullName") <*>
(o .:? "familyName"))
instance ToJSON Name where
toJSON Name'{..}
= object
(catMaybes
[("givenName" .=) <$> _nGivenName,
("fullName" .=) <$> _nFullName,
("familyName" .=) <$> _nFamilyName])
data ListCoursesResponse = ListCoursesResponse'
{ _lcrNextPageToken :: !(Maybe Text)
, _lcrCourses :: !(Maybe [Course])
} deriving (Eq,Show,Data,Typeable,Generic)
listCoursesResponse
:: ListCoursesResponse
listCoursesResponse =
ListCoursesResponse'
{ _lcrNextPageToken = Nothing
, _lcrCourses = Nothing
}
lcrNextPageToken :: Lens' ListCoursesResponse (Maybe Text)
lcrNextPageToken
= lens _lcrNextPageToken
(\ s a -> s{_lcrNextPageToken = a})
lcrCourses :: Lens' ListCoursesResponse [Course]
lcrCourses
= lens _lcrCourses (\ s a -> s{_lcrCourses = a}) .
_Default
. _Coerce
instance FromJSON ListCoursesResponse where
parseJSON
= withObject "ListCoursesResponse"
(\ o ->
ListCoursesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "courses" .!= mempty))
instance ToJSON ListCoursesResponse where
toJSON ListCoursesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lcrNextPageToken,
("courses" .=) <$> _lcrCourses])
data TurnInStudentSubmissionRequest =
TurnInStudentSubmissionRequest'
deriving (Eq,Show,Data,Typeable,Generic)
turnInStudentSubmissionRequest
:: TurnInStudentSubmissionRequest
turnInStudentSubmissionRequest = TurnInStudentSubmissionRequest'
instance FromJSON TurnInStudentSubmissionRequest
where
parseJSON
= withObject "TurnInStudentSubmissionRequest"
(\ o -> pure TurnInStudentSubmissionRequest')
instance ToJSON TurnInStudentSubmissionRequest where
toJSON = const emptyObject
data UserProFile = UserProFile'
{ _upfPhotoURL :: !(Maybe Text)
, _upfName :: !(Maybe Name)
, _upfEmailAddress :: !(Maybe Text)
, _upfId :: !(Maybe Text)
, _upfPermissions :: !(Maybe [GlobalPermission])
} deriving (Eq,Show,Data,Typeable,Generic)
userProFile
:: UserProFile
userProFile =
UserProFile'
{ _upfPhotoURL = Nothing
, _upfName = Nothing
, _upfEmailAddress = Nothing
, _upfId = Nothing
, _upfPermissions = Nothing
}
upfPhotoURL :: Lens' UserProFile (Maybe Text)
upfPhotoURL
= lens _upfPhotoURL (\ s a -> s{_upfPhotoURL = a})
upfName :: Lens' UserProFile (Maybe Name)
upfName = lens _upfName (\ s a -> s{_upfName = a})
upfEmailAddress :: Lens' UserProFile (Maybe Text)
upfEmailAddress
= lens _upfEmailAddress
(\ s a -> s{_upfEmailAddress = a})
upfId :: Lens' UserProFile (Maybe Text)
upfId = lens _upfId (\ s a -> s{_upfId = a})
upfPermissions :: Lens' UserProFile [GlobalPermission]
upfPermissions
= lens _upfPermissions
(\ s a -> s{_upfPermissions = a})
. _Default
. _Coerce
instance FromJSON UserProFile where
parseJSON
= withObject "UserProFile"
(\ o ->
UserProFile' <$>
(o .:? "photoUrl") <*> (o .:? "name") <*>
(o .:? "emailAddress")
<*> (o .:? "id")
<*> (o .:? "permissions" .!= mempty))
instance ToJSON UserProFile where
toJSON UserProFile'{..}
= object
(catMaybes
[("photoUrl" .=) <$> _upfPhotoURL,
("name" .=) <$> _upfName,
("emailAddress" .=) <$> _upfEmailAddress,
("id" .=) <$> _upfId,
("permissions" .=) <$> _upfPermissions])
data DriveFolder = DriveFolder'
{ _dId :: !(Maybe Text)
, _dTitle :: !(Maybe Text)
, _dAlternateLink :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
driveFolder
:: DriveFolder
driveFolder =
DriveFolder'
{ _dId = Nothing
, _dTitle = Nothing
, _dAlternateLink = Nothing
}
dId :: Lens' DriveFolder (Maybe Text)
dId = lens _dId (\ s a -> s{_dId = a})
dTitle :: Lens' DriveFolder (Maybe Text)
dTitle = lens _dTitle (\ s a -> s{_dTitle = a})
dAlternateLink :: Lens' DriveFolder (Maybe Text)
dAlternateLink
= lens _dAlternateLink
(\ s a -> s{_dAlternateLink = a})
instance FromJSON DriveFolder where
parseJSON
= withObject "DriveFolder"
(\ o ->
DriveFolder' <$>
(o .:? "id") <*> (o .:? "title") <*>
(o .:? "alternateLink"))
instance ToJSON DriveFolder where
toJSON DriveFolder'{..}
= object
(catMaybes
[("id" .=) <$> _dId, ("title" .=) <$> _dTitle,
("alternateLink" .=) <$> _dAlternateLink])
newtype MultipleChoiceQuestion = MultipleChoiceQuestion'
{ _mcqChoices :: Maybe [Text]
} deriving (Eq,Show,Data,Typeable,Generic)
multipleChoiceQuestion
:: MultipleChoiceQuestion
multipleChoiceQuestion =
MultipleChoiceQuestion'
{ _mcqChoices = Nothing
}
mcqChoices :: Lens' MultipleChoiceQuestion [Text]
mcqChoices
= lens _mcqChoices (\ s a -> s{_mcqChoices = a}) .
_Default
. _Coerce
instance FromJSON MultipleChoiceQuestion where
parseJSON
= withObject "MultipleChoiceQuestion"
(\ o ->
MultipleChoiceQuestion' <$>
(o .:? "choices" .!= mempty))
instance ToJSON MultipleChoiceQuestion where
toJSON MultipleChoiceQuestion'{..}
= object (catMaybes [("choices" .=) <$> _mcqChoices])
data Course = Course'
{ _cCreationTime :: !(Maybe Text)
, _cRoom :: !(Maybe Text)
, _cCourseMaterialSets :: !(Maybe [CourseMaterialSet])
, _cTeacherGroupEmail :: !(Maybe Text)
, _cTeacherFolder :: !(Maybe DriveFolder)
, _cCourseState :: !(Maybe Text)
, _cGuardiansEnabled :: !(Maybe Bool)
, _cEnrollmentCode :: !(Maybe Text)
, _cUpdateTime :: !(Maybe Text)
, _cOwnerId :: !(Maybe Text)
, _cName :: !(Maybe Text)
, _cId :: !(Maybe Text)
, _cAlternateLink :: !(Maybe Text)
, _cCourseGroupEmail :: !(Maybe Text)
, _cDescription :: !(Maybe Text)
, _cDescriptionHeading :: !(Maybe Text)
, _cSection :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
course
:: Course
course =
Course'
{ _cCreationTime = Nothing
, _cRoom = Nothing
, _cCourseMaterialSets = Nothing
, _cTeacherGroupEmail = Nothing
, _cTeacherFolder = Nothing
, _cCourseState = Nothing
, _cGuardiansEnabled = Nothing
, _cEnrollmentCode = Nothing
, _cUpdateTime = Nothing
, _cOwnerId = Nothing
, _cName = Nothing
, _cId = Nothing
, _cAlternateLink = Nothing
, _cCourseGroupEmail = Nothing
, _cDescription = Nothing
, _cDescriptionHeading = Nothing
, _cSection = Nothing
}
cCreationTime :: Lens' Course (Maybe Text)
cCreationTime
= lens _cCreationTime
(\ s a -> s{_cCreationTime = a})
cRoom :: Lens' Course (Maybe Text)
cRoom = lens _cRoom (\ s a -> s{_cRoom = a})
cCourseMaterialSets :: Lens' Course [CourseMaterialSet]
cCourseMaterialSets
= lens _cCourseMaterialSets
(\ s a -> s{_cCourseMaterialSets = a})
. _Default
. _Coerce
cTeacherGroupEmail :: Lens' Course (Maybe Text)
cTeacherGroupEmail
= lens _cTeacherGroupEmail
(\ s a -> s{_cTeacherGroupEmail = a})
cTeacherFolder :: Lens' Course (Maybe DriveFolder)
cTeacherFolder
= lens _cTeacherFolder
(\ s a -> s{_cTeacherFolder = a})
cCourseState :: Lens' Course (Maybe Text)
cCourseState
= lens _cCourseState (\ s a -> s{_cCourseState = a})
cGuardiansEnabled :: Lens' Course (Maybe Bool)
cGuardiansEnabled
= lens _cGuardiansEnabled
(\ s a -> s{_cGuardiansEnabled = a})
cEnrollmentCode :: Lens' Course (Maybe Text)
cEnrollmentCode
= lens _cEnrollmentCode
(\ s a -> s{_cEnrollmentCode = a})
cUpdateTime :: Lens' Course (Maybe Text)
cUpdateTime
= lens _cUpdateTime (\ s a -> s{_cUpdateTime = a})
cOwnerId :: Lens' Course (Maybe Text)
cOwnerId = lens _cOwnerId (\ s a -> s{_cOwnerId = a})
cName :: Lens' Course (Maybe Text)
cName = lens _cName (\ s a -> s{_cName = a})
cId :: Lens' Course (Maybe Text)
cId = lens _cId (\ s a -> s{_cId = a})
cAlternateLink :: Lens' Course (Maybe Text)
cAlternateLink
= lens _cAlternateLink
(\ s a -> s{_cAlternateLink = a})
cCourseGroupEmail :: Lens' Course (Maybe Text)
cCourseGroupEmail
= lens _cCourseGroupEmail
(\ s a -> s{_cCourseGroupEmail = a})
cDescription :: Lens' Course (Maybe Text)
cDescription
= lens _cDescription (\ s a -> s{_cDescription = a})
cDescriptionHeading :: Lens' Course (Maybe Text)
cDescriptionHeading
= lens _cDescriptionHeading
(\ s a -> s{_cDescriptionHeading = a})
cSection :: Lens' Course (Maybe Text)
cSection = lens _cSection (\ s a -> s{_cSection = a})
instance FromJSON Course where
parseJSON
= withObject "Course"
(\ o ->
Course' <$>
(o .:? "creationTime") <*> (o .:? "room") <*>
(o .:? "courseMaterialSets" .!= mempty)
<*> (o .:? "teacherGroupEmail")
<*> (o .:? "teacherFolder")
<*> (o .:? "courseState")
<*> (o .:? "guardiansEnabled")
<*> (o .:? "enrollmentCode")
<*> (o .:? "updateTime")
<*> (o .:? "ownerId")
<*> (o .:? "name")
<*> (o .:? "id")
<*> (o .:? "alternateLink")
<*> (o .:? "courseGroupEmail")
<*> (o .:? "description")
<*> (o .:? "descriptionHeading")
<*> (o .:? "section"))
instance ToJSON Course where
toJSON Course'{..}
= object
(catMaybes
[("creationTime" .=) <$> _cCreationTime,
("room" .=) <$> _cRoom,
("courseMaterialSets" .=) <$> _cCourseMaterialSets,
("teacherGroupEmail" .=) <$> _cTeacherGroupEmail,
("teacherFolder" .=) <$> _cTeacherFolder,
("courseState" .=) <$> _cCourseState,
("guardiansEnabled" .=) <$> _cGuardiansEnabled,
("enrollmentCode" .=) <$> _cEnrollmentCode,
("updateTime" .=) <$> _cUpdateTime,
("ownerId" .=) <$> _cOwnerId, ("name" .=) <$> _cName,
("id" .=) <$> _cId,
("alternateLink" .=) <$> _cAlternateLink,
("courseGroupEmail" .=) <$> _cCourseGroupEmail,
("description" .=) <$> _cDescription,
("descriptionHeading" .=) <$> _cDescriptionHeading,
("section" .=) <$> _cSection])
data TimeOfDay' = TimeOfDay''
{ _todNanos :: !(Maybe (Textual Int32))
, _todHours :: !(Maybe (Textual Int32))
, _todMinutes :: !(Maybe (Textual Int32))
, _todSeconds :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
timeOfDay
:: TimeOfDay'
timeOfDay =
TimeOfDay''
{ _todNanos = Nothing
, _todHours = Nothing
, _todMinutes = Nothing
, _todSeconds = Nothing
}
todNanos :: Lens' TimeOfDay' (Maybe Int32)
todNanos
= lens _todNanos (\ s a -> s{_todNanos = a}) .
mapping _Coerce
todHours :: Lens' TimeOfDay' (Maybe Int32)
todHours
= lens _todHours (\ s a -> s{_todHours = a}) .
mapping _Coerce
todMinutes :: Lens' TimeOfDay' (Maybe Int32)
todMinutes
= lens _todMinutes (\ s a -> s{_todMinutes = a}) .
mapping _Coerce
todSeconds :: Lens' TimeOfDay' (Maybe Int32)
todSeconds
= lens _todSeconds (\ s a -> s{_todSeconds = a}) .
mapping _Coerce
instance FromJSON TimeOfDay' where
parseJSON
= withObject "TimeOfDay"
(\ o ->
TimeOfDay'' <$>
(o .:? "nanos") <*> (o .:? "hours") <*>
(o .:? "minutes")
<*> (o .:? "seconds"))
instance ToJSON TimeOfDay' where
toJSON TimeOfDay''{..}
= object
(catMaybes
[("nanos" .=) <$> _todNanos,
("hours" .=) <$> _todHours,
("minutes" .=) <$> _todMinutes,
("seconds" .=) <$> _todSeconds])
data ListGuardianInvitationsResponse = ListGuardianInvitationsResponse'
{ _lgirNextPageToken :: !(Maybe Text)
, _lgirGuardianInvitations :: !(Maybe [GuardianInvitation])
} deriving (Eq,Show,Data,Typeable,Generic)
listGuardianInvitationsResponse
:: ListGuardianInvitationsResponse
listGuardianInvitationsResponse =
ListGuardianInvitationsResponse'
{ _lgirNextPageToken = Nothing
, _lgirGuardianInvitations = Nothing
}
lgirNextPageToken :: Lens' ListGuardianInvitationsResponse (Maybe Text)
lgirNextPageToken
= lens _lgirNextPageToken
(\ s a -> s{_lgirNextPageToken = a})
lgirGuardianInvitations :: Lens' ListGuardianInvitationsResponse [GuardianInvitation]
lgirGuardianInvitations
= lens _lgirGuardianInvitations
(\ s a -> s{_lgirGuardianInvitations = a})
. _Default
. _Coerce
instance FromJSON ListGuardianInvitationsResponse
where
parseJSON
= withObject "ListGuardianInvitationsResponse"
(\ o ->
ListGuardianInvitationsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "guardianInvitations" .!= mempty))
instance ToJSON ListGuardianInvitationsResponse where
toJSON ListGuardianInvitationsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lgirNextPageToken,
("guardianInvitations" .=) <$>
_lgirGuardianInvitations])
newtype Assignment = Assignment'
{ _aStudentWorkFolder :: Maybe DriveFolder
} deriving (Eq,Show,Data,Typeable,Generic)
assignment
:: Assignment
assignment =
Assignment'
{ _aStudentWorkFolder = Nothing
}
aStudentWorkFolder :: Lens' Assignment (Maybe DriveFolder)
aStudentWorkFolder
= lens _aStudentWorkFolder
(\ s a -> s{_aStudentWorkFolder = a})
instance FromJSON Assignment where
parseJSON
= withObject "Assignment"
(\ o -> Assignment' <$> (o .:? "studentWorkFolder"))
instance ToJSON Assignment where
toJSON Assignment'{..}
= object
(catMaybes
[("studentWorkFolder" .=) <$> _aStudentWorkFolder])
data ListStudentsResponse = ListStudentsResponse'
{ _lsrNextPageToken :: !(Maybe Text)
, _lsrStudents :: !(Maybe [Student])
} deriving (Eq,Show,Data,Typeable,Generic)
listStudentsResponse
:: ListStudentsResponse
listStudentsResponse =
ListStudentsResponse'
{ _lsrNextPageToken = Nothing
, _lsrStudents = Nothing
}
lsrNextPageToken :: Lens' ListStudentsResponse (Maybe Text)
lsrNextPageToken
= lens _lsrNextPageToken
(\ s a -> s{_lsrNextPageToken = a})
lsrStudents :: Lens' ListStudentsResponse [Student]
lsrStudents
= lens _lsrStudents (\ s a -> s{_lsrStudents = a}) .
_Default
. _Coerce
instance FromJSON ListStudentsResponse where
parseJSON
= withObject "ListStudentsResponse"
(\ o ->
ListStudentsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "students" .!= mempty))
instance ToJSON ListStudentsResponse where
toJSON ListStudentsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lsrNextPageToken,
("students" .=) <$> _lsrStudents])
data SharedDriveFile = SharedDriveFile'
{ _sdfDriveFile :: !(Maybe DriveFile)
, _sdfShareMode :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
sharedDriveFile
:: SharedDriveFile
sharedDriveFile =
SharedDriveFile'
{ _sdfDriveFile = Nothing
, _sdfShareMode = Nothing
}
sdfDriveFile :: Lens' SharedDriveFile (Maybe DriveFile)
sdfDriveFile
= lens _sdfDriveFile (\ s a -> s{_sdfDriveFile = a})
sdfShareMode :: Lens' SharedDriveFile (Maybe Text)
sdfShareMode
= lens _sdfShareMode (\ s a -> s{_sdfShareMode = a})
instance FromJSON SharedDriveFile where
parseJSON
= withObject "SharedDriveFile"
(\ o ->
SharedDriveFile' <$>
(o .:? "driveFile") <*> (o .:? "shareMode"))
instance ToJSON SharedDriveFile where
toJSON SharedDriveFile'{..}
= object
(catMaybes
[("driveFile" .=) <$> _sdfDriveFile,
("shareMode" .=) <$> _sdfShareMode])
newtype CourseAlias = CourseAlias'
{ _caAlias :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
courseAlias
:: CourseAlias
courseAlias =
CourseAlias'
{ _caAlias = Nothing
}
caAlias :: Lens' CourseAlias (Maybe Text)
caAlias = lens _caAlias (\ s a -> s{_caAlias = a})
instance FromJSON CourseAlias where
parseJSON
= withObject "CourseAlias"
(\ o -> CourseAlias' <$> (o .:? "alias"))
instance ToJSON CourseAlias where
toJSON CourseAlias'{..}
= object (catMaybes [("alias" .=) <$> _caAlias])
data Form = Form'
{ _fThumbnailURL :: !(Maybe Text)
, _fFormURL :: !(Maybe Text)
, _fTitle :: !(Maybe Text)
, _fResponseURL :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
form
:: Form
form =
Form'
{ _fThumbnailURL = Nothing
, _fFormURL = Nothing
, _fTitle = Nothing
, _fResponseURL = Nothing
}
fThumbnailURL :: Lens' Form (Maybe Text)
fThumbnailURL
= lens _fThumbnailURL
(\ s a -> s{_fThumbnailURL = a})
fFormURL :: Lens' Form (Maybe Text)
fFormURL = lens _fFormURL (\ s a -> s{_fFormURL = a})
fTitle :: Lens' Form (Maybe Text)
fTitle = lens _fTitle (\ s a -> s{_fTitle = a})
fResponseURL :: Lens' Form (Maybe Text)
fResponseURL
= lens _fResponseURL (\ s a -> s{_fResponseURL = a})
instance FromJSON Form where
parseJSON
= withObject "Form"
(\ o ->
Form' <$>
(o .:? "thumbnailUrl") <*> (o .:? "formUrl") <*>
(o .:? "title")
<*> (o .:? "responseUrl"))
instance ToJSON Form where
toJSON Form'{..}
= object
(catMaybes
[("thumbnailUrl" .=) <$> _fThumbnailURL,
("formUrl" .=) <$> _fFormURL,
("title" .=) <$> _fTitle,
("responseUrl" .=) <$> _fResponseURL])
data ListTeachersResponse = ListTeachersResponse'
{ _ltrNextPageToken :: !(Maybe Text)
, _ltrTeachers :: !(Maybe [Teacher])
} deriving (Eq,Show,Data,Typeable,Generic)
listTeachersResponse
:: ListTeachersResponse
listTeachersResponse =
ListTeachersResponse'
{ _ltrNextPageToken = Nothing
, _ltrTeachers = Nothing
}
ltrNextPageToken :: Lens' ListTeachersResponse (Maybe Text)
ltrNextPageToken
= lens _ltrNextPageToken
(\ s a -> s{_ltrNextPageToken = a})
ltrTeachers :: Lens' ListTeachersResponse [Teacher]
ltrTeachers
= lens _ltrTeachers (\ s a -> s{_ltrTeachers = a}) .
_Default
. _Coerce
instance FromJSON ListTeachersResponse where
parseJSON
= withObject "ListTeachersResponse"
(\ o ->
ListTeachersResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "teachers" .!= mempty))
instance ToJSON ListTeachersResponse where
toJSON ListTeachersResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _ltrNextPageToken,
("teachers" .=) <$> _ltrTeachers])
data Student = Student'
{ _sCourseId :: !(Maybe Text)
, _sProFile :: !(Maybe UserProFile)
, _sStudentWorkFolder :: !(Maybe DriveFolder)
, _sUserId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
student
:: Student
student =
Student'
{ _sCourseId = Nothing
, _sProFile = Nothing
, _sStudentWorkFolder = Nothing
, _sUserId = Nothing
}
sCourseId :: Lens' Student (Maybe Text)
sCourseId
= lens _sCourseId (\ s a -> s{_sCourseId = a})
sProFile :: Lens' Student (Maybe UserProFile)
sProFile = lens _sProFile (\ s a -> s{_sProFile = a})
sStudentWorkFolder :: Lens' Student (Maybe DriveFolder)
sStudentWorkFolder
= lens _sStudentWorkFolder
(\ s a -> s{_sStudentWorkFolder = a})
sUserId :: Lens' Student (Maybe Text)
sUserId = lens _sUserId (\ s a -> s{_sUserId = a})
instance FromJSON Student where
parseJSON
= withObject "Student"
(\ o ->
Student' <$>
(o .:? "courseId") <*> (o .:? "profile") <*>
(o .:? "studentWorkFolder")
<*> (o .:? "userId"))
instance ToJSON Student where
toJSON Student'{..}
= object
(catMaybes
[("courseId" .=) <$> _sCourseId,
("profile" .=) <$> _sProFile,
("studentWorkFolder" .=) <$> _sStudentWorkFolder,
("userId" .=) <$> _sUserId])