From c6562f7db338fadc90de057d6164130bd8cfba24 Mon Sep 17 00:00:00 2001 From: Timo Ley Date: Sat, 18 Jan 2020 23:40:30 +0100 Subject: [PATCH] Add getTimegridUnits --- src/main/java/ley/untis/UntisClient.java | 8 ++++++++ .../java/ley/untis/data/TimegridResponse.java | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/main/java/ley/untis/data/TimegridResponse.java diff --git a/src/main/java/ley/untis/UntisClient.java b/src/main/java/ley/untis/UntisClient.java index 9be551c..0560a85 100644 --- a/src/main/java/ley/untis/UntisClient.java +++ b/src/main/java/ley/untis/UntisClient.java @@ -189,5 +189,13 @@ public class UntisClient { } } + public TimegridResponse getTimegridUnits() throws APIRequestException { + try { + return client.invoke("getTimegridUnits", new Object[0], TimegridResponse.class); + } catch (Throwable e) { + throw new APIRequestException(e); + } + } + } diff --git a/src/main/java/ley/untis/data/TimegridResponse.java b/src/main/java/ley/untis/data/TimegridResponse.java new file mode 100644 index 0000000..379c2eb --- /dev/null +++ b/src/main/java/ley/untis/data/TimegridResponse.java @@ -0,0 +1,17 @@ +package ley.untis.data; + +import java.util.ArrayList; + +public class TimegridResponse extends ArrayList { + + public static class Day { + public int day; + public TimeUnit[] timeUnits; + public static class TimeUnit { + public int startTime; + public int endTime; + public String name; + } + } + +}