Add getDepartments and getHolidays
This commit is contained in:
parent
1ad393f107
commit
9e23125522
|
@ -163,5 +163,31 @@ public class UntisClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of departments
|
||||||
|
* @return an ArrayList of departments
|
||||||
|
* @throws APIRequestException
|
||||||
|
*/
|
||||||
|
public DepartmentResponse getDepartments() throws APIRequestException {
|
||||||
|
try {
|
||||||
|
return client.invoke("getDepartments", new Object[0], DepartmentResponse.class);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
throw new APIRequestException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of holidays
|
||||||
|
* @return an ArrayList of holidays
|
||||||
|
* @throws APIRequestException
|
||||||
|
*/
|
||||||
|
public HolidayResponse getHolidays() throws APIRequestException {
|
||||||
|
try {
|
||||||
|
return client.invoke("getHolidays", new Object[0], HolidayResponse.class);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
throw new APIRequestException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
13
src/main/java/ley/untis/data/DepartmentResponse.java
Normal file
13
src/main/java/ley/untis/data/DepartmentResponse.java
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
package ley.untis.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class DepartmentResponse extends ArrayList<DepartmentResponse.Department> {
|
||||||
|
|
||||||
|
public static class Department {
|
||||||
|
public int id;
|
||||||
|
public String name;
|
||||||
|
public String longName;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
15
src/main/java/ley/untis/data/HolidayResponse.java
Normal file
15
src/main/java/ley/untis/data/HolidayResponse.java
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
package ley.untis.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class HolidayResponse extends ArrayList<HolidayResponse.Holiday> {
|
||||||
|
|
||||||
|
public static class Holiday {
|
||||||
|
public int id;
|
||||||
|
public String name;
|
||||||
|
public String longName;
|
||||||
|
public int startDate;
|
||||||
|
public int endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue