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 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 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 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 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 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 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 Course = Course
{ _cCreationTime :: !(Maybe Text)
, _cRoom :: !(Maybe Text)
, _cCourseState :: !(Maybe Text)
, _cEnrollmentCode :: !(Maybe Text)
, _cUpdateTime :: !(Maybe Text)
, _cOwnerId :: !(Maybe Text)
, _cName :: !(Maybe Text)
, _cId :: !(Maybe Text)
, _cAlternateLink :: !(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
, _cCourseState = Nothing
, _cEnrollmentCode = Nothing
, _cUpdateTime = Nothing
, _cOwnerId = Nothing
, _cName = Nothing
, _cId = Nothing
, _cAlternateLink = 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})
cCourseState :: Lens' Course (Maybe Text)
cCourseState
= lens _cCourseState (\ s a -> s{_cCourseState = 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})
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 .:? "courseState")
<*> (o .:? "enrollmentCode")
<*> (o .:? "updateTime")
<*> (o .:? "ownerId")
<*> (o .:? "name")
<*> (o .:? "id")
<*> (o .:? "alternateLink")
<*> (o .:? "description")
<*> (o .:? "descriptionHeading")
<*> (o .:? "section"))
instance ToJSON Course where
toJSON Course{..}
= object
(catMaybes
[("creationTime" .=) <$> _cCreationTime,
("room" .=) <$> _cRoom,
("courseState" .=) <$> _cCourseState,
("enrollmentCode" .=) <$> _cEnrollmentCode,
("updateTime" .=) <$> _cUpdateTime,
("ownerId" .=) <$> _cOwnerId, ("name" .=) <$> _cName,
("id" .=) <$> _cId,
("alternateLink" .=) <$> _cAlternateLink,
("description" .=) <$> _cDescription,
("descriptionHeading" .=) <$> _cDescriptionHeading,
("section" .=) <$> _cSection])
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])
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 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)
, _sUserId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
student
:: Student
student =
Student
{ _sCourseId = Nothing
, _sProFile = 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})
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 .:? "userId"))
instance ToJSON Student where
toJSON Student{..}
= object
(catMaybes
[("courseId" .=) <$> _sCourseId,
("profile" .=) <$> _sProFile,
("userId" .=) <$> _sUserId])