Skip to content

This class library provides a client .NET implementation for interacting with the Orel State University schedule API.

License

Notifications You must be signed in to change notification settings

XDenizX/OrelStateUniversity.Schedule.API

Repository files navigation

Orel State University Schedule API

.Net C#

This class library provides a client .NET implementation for interacting with the Orel State University Schedule API.

This library is not official.

Features

  • Getting a list of divisions for students;
  • Getting a list of courses;
  • Getting a list of groups;
  • Getting a schedule for a group for 7 days starting from the current moment.

Install

You can install this package at this link or using the following commands:

Install-Package OrelStateUniversity.API -Version 1.0.1

or

dotnet add package OrelStateUniversity.API --version 1.0.1

Usage

To start working with the API, you need to create an instance of the ScheduleApiClient class.

For example, as follows:

IScheduleApiClient client = new ScheduleApiClient();

To get a list of divisions available to students, you need to use the GetStudentDivisionsAsync method.

For example, as follows:

IEnumerable<Division> divisions = await client.GetStudentDivisionsAsync();

To get a list of available courses for the specified division, use the GetCoursesAsync method.

For example, as follows:

Division division = divisions.FirstOrDefault();
IEnumerable<Course> courses = await client.GetCoursesAsync(division.Id);

To get a list of all groups for the specified division on the specified course, use the GetGroupsAsync method.

For example, as follows:

Course course = courses.FirstOrDefault();
IEnumerable<Group> groups = await client.GetGroupsAsync(division.Id, course.Number);

To get a schedule for the specified group, use the GetScheduleAsync method.

For example, as follows:

Group group = groups.FirstOrDefault();
Schedule schedule = await client.GetScheduleAsync(group.Id);

Lessons for 7 days starting from the current moment will be available in the Lessons property.

For example, as follows:

Lesson lesson = schedule.Lessons.FirstOrDefault();

// Process the information about the lesson.

Non-asynchronous call

You can use all of these methods in non-synchronous projects as follows:

Schedule schedule = client.GetScheduleAsync(group.Id)
  .GetAwaiter()
  .GetResult();

About

This class library provides a client .NET implementation for interacting with the Orel State University schedule API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages