untisApi

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ANSI escape codes for colors
	Reset  = "\033[0m"
	Red    = "\033[31m"
	Green  = "\033[32m"
	Yellow = "\033[33m"
	Blue   = "\033[34m"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	structs.ApiConfig
	structs.AuthResponse
	Logger *logger
}

func NewClient

func NewClient(apiConfig structs.ApiConfig, logger *log.Logger, LogLevel LogLevel) *Client

func (*Client) Authenticate

func (c *Client) Authenticate() error

func (*Client) CallRPC

func (c *Client) CallRPC(method string, params interface{}) (*structs.RPCResponse, error)

func (*Client) ContinueSession added in v1.1.0

func (c *Client) ContinueSession(SessionID string) error

func (*Client) GetClasses

func (c *Client) GetClasses(params ...interface{}) ([]structs.Class, error)

Get all classes of the current schoolYear from the Api

func (*Client) GetClassesOfSchoolYear

func (c *Client) GetClassesOfSchoolYear(schoolYearID int) ([]structs.Class, error)

Get all classes of the given schoolYear from the Api

func (*Client) GetCurrentSchoolyear

func (c *Client) GetCurrentSchoolyear() (structs.SchoolYear, error)

Data for the current schoolyear

func (*Client) GetDepartments

func (c *Client) GetDepartments() ([]structs.Department, error)

func (*Client) GetExamTypes

func (c *Client) GetExamTypes() (json.RawMessage, error)

Request classregevents for the given date range

func (*Client) GetExams

func (c *Client) GetExams(params structs.GetExamsRequest) ([]structs.Exam, error)

Request classregevents for the given date range

func (*Client) GetHolidays

func (c *Client) GetHolidays() ([]structs.Holiday, error)

func (*Client) GetLatestImportTime

func (c *Client) GetLatestImportTime() (int, error)

Import time of the last lesson/timetable or substitution import from Untis, returns Unix timestamp

func (*Client) GetPersonId

func (c *Client) GetPersonId(params structs.GetPersonIdRequest) (int, error)

Get Id of the person (teacher or student) from the name, returns: Id of person or 0 if no fitting person found

func (*Client) GetRooms added in v1.0.4

func (c *Client) GetRooms() ([]structs.Room, error)

func (*Client) GetSchoolyears

func (c *Client) GetSchoolyears() ([]structs.SchoolYear, error)

List of all available schoolyears

func (*Client) GetStatusData

func (c *Client) GetStatusData() (structs.StatusData, error)

Information about lesson types and period codes and their colors

func (*Client) GetStudents

func (c *Client) GetStudents() ([]structs.Student, error)

Get a list of all students

func (*Client) GetSubjects

func (c *Client) GetSubjects() ([]structs.Subject, error)

func (*Client) GetSubstitutions

func (c *Client) GetSubstitutions(params structs.GetSubstitutionsRequest) ([]structs.Substitutions, error)

Request substitutions for the given date range

func (*Client) GetTeachers

func (c *Client) GetTeachers() ([]structs.Teacher, error)

Get list of teachers form Api

func (*Client) GetTimegridUnits

func (c *Client) GetTimegridUnits() ([]structs.TimegridUnit, error)

Get timegrid

func (*Client) GetTimetable

func (c *Client) GetTimetable(params structs.GetTimetableRequest) ([]structs.Period, error)

Get a customizable timetable for classes, teacher, student, room, subject..

func (*Client) GetTimetableSimple

func (c *Client) GetTimetableSimple(params structs.GetTimetableSimpleRequest) ([]structs.Period, error)

Get timetable for Classes, teacher, student, room, subject

func (*Client) GetTimetableWithAbsences

func (c *Client) GetTimetableWithAbsences(params structs.StartAndEndDate) ([]structs.PeriodWithAbsenceObject, error)

Retrieves the timetable for all students together with absene information for a given daterange.

func (*Client) Logout

func (c *Client) Logout() error

func (*Client) Test

func (c *Client) Test() error

type LogLevel added in v1.1.0

type LogLevel int
const (
	DEBUG LogLevel = iota
	INFO
	WARN
	ERROR
	NONE
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL