Documentation ¶
Index ¶
- type Absence
- type AbsencePeriod
- type AccountData
- type Appointment
- type Assignment
- type Classroom
- type Endpoints
- type Grade
- type GradingPeriod
- type LoginOptions
- type Magister
- func (m *Magister) CheckSession() error
- func (m *Magister) GetAbsences(dates ...time.Time) ([]Absence, error)
- func (m *Magister) GetAppointments(dates ...string) ([]Appointment, error)
- func (m *Magister) GetAssignments(startDate time.Time, endDate time.Time, _amount ...int64) ([]Assignment, error)
- func (m *Magister) GetGrades() ([]Grade, error)
- func (m *Magister) GetMessage(messageID int64) (Message, error)
- func (m *Magister) GetMessages(amountOfMessages uint64, skip ...uint64) ([]MessageInfo, error)
- func (m *Magister) RefreshAccessToken() (RefreshAccessTokenResponse, error)
- type Message
- type MessageInfo
- type Persoon
- type RefreshAccessTokenResponse
- type Subject
- type Teacher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Absence ¶
type Absence struct { ID int `magisterjson:"Id" json:"id"` Start time.Time `magisterjson:"Start" json:"start"` End time.Time `magisterjson:"Eind" json:"end"` Period int `magisterjson:"Lesuur" json:"period"` Allowed bool `magisterjson:"Geoorloofd" json:"allowed"` AppointmentID int `magisterjson:"AfspraakId" json:"appointmentID"` Description string `magisterjson:"Omschrijving" json:"description"` AccountabilityType int `magisterjson:"Verantwoordingtype" json:"accountabilityType"` Code string `magisterjson:"Code" json:"code"` Appointment Appointment `magisterjson:"Afspraak" json:"appointment"` }
type AbsencePeriod ¶
type AccountData ¶
type AccountData struct {
Persoon Persoon `json:"Persoon"`
}
type Appointment ¶
type Appointment struct { ID int64 `magisterjson:"Id" json:"id"` // Skip "Links", is that interesting to know? Start string `magisterjson:"Start" json:"start"` End string `magisterjson:"Einde" json:"end"` PeriodStarts int8 `magisterjson:"LesuurVan" json:"periodStarts"` PeriodEnds int8 `magisterjson:"LesuurTotMet" json:"periodEnds"` TakesWholeDay bool `magisterjson:"DuurtHeleDag" json:"TakesWholeDay"` Description string `magisterjson:"Omschrijving" json:"description"` Location string `magisterjson:"Locatie" json:"location"` Status int64 `magisterjson:"Status" json:"status"` Type int64 `magisterjson:"Type" json:"type"` IsOnline bool `magisterjson:"IsOnlineDeelname" json:"isOnline"` DisplayType int64 `magisterjson:"WeergaveType" json:"displayType"` Content string `magisterjson:"Inhoud" json:"content"` InfoType int64 `magisterjson:"InfoType" json:"infoType"` Notes string `magisterjson:"Aantekeningen" json:"notes"` Finished bool `magisterjson:"Afgerond" json:"finished"` RepeatStatus int64 `magisterjson:"HerhaalStatus" json:"repeatStatus"` Repeat string `magisterjson:"Herhaling" json:"repeat"` Subjects []Subject `magisterjson:"Vakken" json:"subjects"` Teachers []Teacher `magisterjson:"Docenten" json:"teachers"` Classrooms []Classroom `magisterjson:"Lokalen" json:"classrooms"` Groups string `magisterjson:"Groepen" json:"groups"` AssignmentID int64 `magisterjson:"OpdrachtId" json:"assignmentID"` HasAttachements bool `magisterjson:"HeeftBijlagen" json:"hasAttachments"` Attachments string `magisterjson:"Bijlagen" json:"attachments"` }
Appointment contains all the info about an appointment
func (*Appointment) GetInfoType ¶
func (appointment *Appointment) GetInfoType() string
GetInfoType returns the info type of the appointment as a string
func (*Appointment) GetStatus ¶
func (appointment *Appointment) GetStatus() string
GetStatus returns the status of the appointment as a string
func (*Appointment) GetType ¶
func (appointment *Appointment) GetType() string
GetType returns the type of the appointment as a string
type Assignment ¶
type Assignment struct { ID int `magisterjson:"Id" json:"id"` Links []struct { Rel string `magisterjson:"Rel" json:"rel"` Href string `magisterjson:"Href" json:"href"` } `magisterjson:"Links"` Title string `magisterjson:"Titel" json:"title"` Subject string `magisterjson:"Vak" json:"subject"` HandInBefore time.Time `magisterjson:"InleverenVoor" json:"handInBefore"` HandedInAt interface{} `magisterjson:"IngeleverdOp" json:"handedInAt"` StatusLastAssignmentVersion int `magisterjson:"StatusLaatsteOpdrachtVersie" json:"statusLastAssignmentVersion"` LastAssignmentVersionNumber int `magisterjson:"LaatsteOpdrachtVersienummer" json:"lastAssignmentVersionNumber"` Attachments []interface{} `magisterjson:"Bijlagen" json:"attachments"` Teachers interface{} `magisterjson:"Docenten" json:"teachers"` Description string `magisterjson:"Omschrijving" json:"description"` Grading string `magisterjson:"Beoordeling" json:"grading"` GradedAt time.Time `magisterjson:"BeoordeeldOp" json:"gradedAt"` HandInAgain bool `magisterjson:"OpnieuwInleveren" json:"handInAgain"` Closed bool `magisterjson:"Afgesloten" json:"closed"` AllowedToHandIn bool `magisterjson:"MagInleveren" json:"allowedToHandIn"` }
Assignment contains information about an assignment
type Endpoints ¶
type Endpoints struct { Issuer string `json:"issuer"` JWKSUri string `json:"jwks_uri"` AuthorizationEndpoint string `json:"authorization_endpoint"` TokenEndpoint string `json:"token_endpoint"` UserInfoEndpoint string `json:"userinfo_endpoint"` EndSessionEndpoint string `json:"end_session_endpoint"` CheckSessionIframe string `json:"check_session_endpoint"` RevocationEndpoint string `json:"revocation_endpoint"` FrontChannelLogoutSupported bool `json:"frontchannel_logout_supported"` FrontChannelLogoutSessionSupported bool `json:"frontchannel_logout_session_supported"` BackChannelLogoutSupported bool `json:"backchannel_logout_supported"` BackChannelLogoutSessionSupported bool `json:"backchannel_logout_session_supported"` ScopesSupported [4]string `json:"scopes_supported"` ClaimsSupported [19]string `json:"claims_supported"` GrantTypesSupported [6]string `json:"grant_types_supported"` ResponseTypesSupported [7]string `json:"response_types_supported"` ResponseModesSupported [4]string `json:"response_modes_supported"` TokenEndpointAuthMethodsSupported [2]string `json:"token_endpoint_auth_methods_supported"` IDTokenSigningAlgValuesSupported [1]string `json:"id_token_signing_alg_values_supported"` SubjectTypesSupported [1]string `json:"subject_types_supported"` CodeChallengeMethodsSupported [2]string `json:"code_challenge_methods_supported"` RequestParameterSupported bool `json:"request_parameter_supported"` TenantsEndpoint string `json:"tenants_endpoint"` }
Endpoints contains all the information about the Magister endpoints (I guess)
type Grade ¶
type Grade struct { GradeID int `magisterjson:"CijferId" json:"gradeID"` GradeStr string `magisterjson:"CijferStr" json:"gradeStr"` IsSufficient bool `magisterjson:"IsVoldoende" json:"isSufficient"` EnteredBy string `magisterjson:"IngevoerdDoor" json:"enteredBy"` DateEntered time.Time `magisterjson:"DatumIngevoerd" json:"dateEntered"` GradingPeriod struct { ID int `magisterjson:"Id" json:"id"` Name string `magisterjson:"Naam" json:"name"` ReferenceNumber int `magisterjson:"VolgNummer" json:"referenceNumber"` } `magisterjson:"CijferPeriode" json:"gradingPeriod"` Subject struct { ID int `magisterjson:"Id" json:"id"` Abbreviation string `magisterjson:"Afkorting" json:"abbreviation"` Description string `magisterjson:"Omschrijving" json:"description"` FollowNumber int `magisterjson:"Volgnr" json:"followNumber"` } `magisterjson:"Vak" json:"subject"` CatchUp bool `magisterjson:"Inhalen" json:"catchUp"` Exemption bool `magisterjson:"Vrijstelling" json:"exemption"` Counts bool `magisterjson:"TeltMee" json:"counts"` GradeColumn struct { ID int `magisterjson:"Id" json:"id"` ColumnName string `magisterjson:"KolomNaam" json:"columnName"` ColumnNumber string `magisterjson:"KolomNummer" json:"columnNumber"` ColumnFollowNumber string `magisterjson:"KolomVolgNummer" json:"columnFollowNumber"` ColumnHeader string `magisterjson:"KolomKop" json:"columnHeader"` ColumnDescription interface{} `magisterjson:"KolomOmschrijving" json:"columnDescription"` ColumnType int `magisterjson:"KolomSoort" json:"columnType"` IsRetakeColumn bool `magisterjson:"IsHerkansingKolom" json:"isRetakeColumn"` IsTeacherColumn bool `magisterjson:"IsDocentKolom" json:"isTeacherColumn"` HasUnderlyingColumns bool `magisterjson:"HeeftOnderliggendeKolommen" json:"HasUnderlyingColumns"` IsPTAColumn bool `magisterjson:"IsPTAKolom" json:"isPTAColumn"` } `magisterjson:"CijferKolom" json:"gradeColumn"` GradeColumnIDEloAssignment int `magisterjson:"CijferKolomIdEloOpdracht" json:"gradeColumnIDEloAssignment"` Teacher string `magisterjson:"Docent" json:"teacher"` SubjectExemption bool `magisterjson:"VakOntheffing" json:"subjectExemption"` SubjectDispensation bool `magisterjson:"VakVrijstelling" json:"subjectDispensation"` }
type GradingPeriod ¶
type GradingPeriod struct { ID int `magisterjson:"id" json:"id"` Study struct { ID int `magisterjson:"id" json:"id"` Code string `magisterjson:"code" json:"code"` Links struct { Self struct { Href string `magisterjson:"href" json:"href"` } `magisterjson:"self" json:"self"` } `magisterjson:"links" json:"links"` } `magisterjson:"studie" json:"study"` Group struct { ID int `magisterjson:"id" json:"id"` Code string `magisterjson:"code" json:"code"` Description string `magisterjson:"omschrijving" json:"description"` Links struct { Self struct { Href string `magisterjson:"href" json:"href"` } `magisterjson:"self" json:"self"` } `magisterjson:"links" json:"links"` } `magisterjson:"groep" json:"group"` ClassPeriod struct { Code string `magisterjson:"code" json:"code"` Links struct { Self struct { Href string `magisterjson:"href" json:"href"` } `magisterjson:"self" json:"self"` } `magisterjson:"links" json:"links"` } `magisterjson:"lesperiode" json:"classPeriod"` StudyProgram []struct { Code string `magisterjson:"code" json:"code"` Links struct { Self struct { Href string `magisterjson:"href" json:"href"` } `magisterjson:"self" json:"self"` } `magisterjson:"links" json:"links"` } `magisterjson:"profielen" json:"studyProgram"` PersonalMentor struct { Initials string `magisterjson:"voorletters" json:"initials"` SurnamePrefix string `magisterjson:"tussenvoegsel" json:"surnamePrefix"` Lastname string `magisterjson:"achternaam" json:"lastName"` Links struct { Self struct { Href string `magisterjson:"href" json:"href"` } `magisterjson:"self" json:"self"` } `magisterjson:"links" json:"links"` } `magisterjson:"persoonlijkeMentor" json:"personalMentor"` Start string `magisterjson:"begin" json:"start"` End string `magisterjson:"einde" json:"end"` IsMainRegistration bool `magisterjson:"isHoofdAanmelding" json:"isMainRegistration"` Links struct { Self struct { Href string `magisterjson:"href" json:"href"` } `magisterjson:"self" json:"self"` Subjects struct { Href string `magisterjson:"href" json:"href"` } `magisterjson:"vakken" json:"subjects"` Periods struct { Href string `magisterjson:"href" json:"href"` } `magisterjson:"perioden" json:"periods"` Grades struct { Href string `magisterjson:"href" json:"href"` } `magisterjson:"cijfers" json:"grades"` Mentors struct { Href string `magisterjson:"href" json:"href"` } `magisterjson:"mentoren" json:"mentors"` } `magisterjson:"links" json:"links"` }
type LoginOptions ¶
type Magister ¶
type Magister struct { Tenant string AccessToken string RefreshToken string AccessTokenExpiresAt int64 Authority string Endpoints Endpoints // ClientID string UserID string HTTPClient http.Client }
func NewMagister ¶
func (*Magister) CheckSession ¶
CheckSession checks if the session has expired
func (*Magister) GetAbsences ¶
func (*Magister) GetAppointments ¶
func (m *Magister) GetAppointments(dates ...string) ([]Appointment, error)
GetAppointments fetches the appointment data from Magister and puts it into a []Appointment
func (*Magister) GetAssignments ¶
func (m *Magister) GetAssignments(startDate time.Time, endDate time.Time, _amount ...int64) ([]Assignment, error)
GetAssignments returns an array of assignments. The third parameter is there if you want to get more/less than 250 assignments.
func (*Magister) GetMessages ¶
func (m *Magister) GetMessages(amountOfMessages uint64, skip ...uint64) ([]MessageInfo, error)
func (*Magister) RefreshAccessToken ¶
func (m *Magister) RefreshAccessToken() (RefreshAccessTokenResponse, error)
RefreshAccessToken refreshes the access token
type Message ¶
type Message struct { Content string `json:"inhoud"` Receivers []struct { ID int `json:"id"` DisplayName string `json:"weergavenaam"` Type string `json:"type"` IsToParent bool `json:"isAanOuder"` Links struct { Self struct { Href string `json:"href"` } `json:"self"` } `json:"links"` } `json:"ontvangers"` CopyReceivers []interface{} `json:"kopieOntvangers"` BlindCopyReceivers []interface{} `json:"blindeKopieOntvangers"` ID int `json:"id"` Subject string `json:"onderwerp"` MapID int `json:"mapId"` Sender struct { ID int `json:"id"` Name string `json:"naam"` Links struct { Self struct { Href string `json:"href"` } `json:"self"` } `json:"links"` } `json:"afzender"` HasPriority bool `json:"heeftPrioriteit"` HasAttachments bool `json:"heeftBijlagen"` Isread bool `json:"isGelezen"` SentAt time.Time `json:"verzondenOp"` ForwardedAt interface{} `json:"doorgestuurdOp"` RepliedAt interface{} `json:"beantwoordOp"` Links struct { Self struct { Href string `json:"href"` } `json:"self"` Map struct { Href string `json:"href"` } `json:"map"` Attachments struct { Href string `json:"href"` } `json:"bijlagen"` } `json:"links"` }
type MessageInfo ¶
type MessageInfo struct { ID int64 `json:"id"` Subject string `json:"onderwerp"` MapID int `json:"mapId"` Sender struct { ID int `json:"id"` Name string `json:"naam"` Links struct { Self struct { Href string `json:"href"` } `json:"self"` } `json:"links"` } `json:"afzender"` HasPriority bool `json:"heeftPrioriteit"` HasAttachments bool `json:"heeftBijlagen"` IsRead bool `json:"isGelezen"` SentAt time.Time `json:"verzondenOp"` ForwaredAt interface{} `json:"doorgestuurdOp"` RepliedAt interface{} `json:"beantwoordOp"` Links struct { Self struct { Href string `json:"href"` } `json:"self"` Map struct { Href string `json:"href"` } `json:"map"` } `json:"links"` }