From 150c0957cabeeb1cf38de904a97bde156c466b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Sun, 21 Jan 2024 17:12:13 +0100 Subject: [PATCH] Add missing unitId field to Sdk --- sdk/api/sdk.api | 4 ++++ sdk/src/main/kotlin/io/github/wulkanowy/sdk/Sdk.kt | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sdk/api/sdk.api b/sdk/api/sdk.api index c029e190..27e8ab08 100644 --- a/sdk/api/sdk.api +++ b/sdk/api/sdk.api @@ -82,6 +82,7 @@ public final class io/github/wulkanowy/sdk/Sdk { public final fun getTeachers (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getTimetable (Ljava/time/LocalDate;Ljava/time/LocalDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getToken (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun getUnitId ()I public final fun getUserAgent ()Ljava/lang/String; public final fun getUserAgentTemplate ()Ljava/lang/String; public final fun getUserSubjectsFromScrapper (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -111,8 +112,11 @@ public final class io/github/wulkanowy/sdk/Sdk { public final fun setSimpleHttpLogger (Lkotlin/jvm/functions/Function1;)V public final fun setStudentId (I)V public final fun setSymbol (Ljava/lang/String;)V + public final fun setUnitId (I)V public final fun setUserAgentTemplate (Ljava/lang/String;)V public final fun switchDiary (III)Lio/github/wulkanowy/sdk/Sdk; + public final fun switchDiary (IIII)Lio/github/wulkanowy/sdk/Sdk; + public static synthetic fun switchDiary$default (Lio/github/wulkanowy/sdk/Sdk;IIIIILjava/lang/Object;)Lio/github/wulkanowy/sdk/Sdk; public final fun unregisterDevice (ILkotlin/coroutines/Continuation;)Ljava/lang/Object; } diff --git a/sdk/src/main/kotlin/io/github/wulkanowy/sdk/Sdk.kt b/sdk/src/main/kotlin/io/github/wulkanowy/sdk/Sdk.kt index d8d34341..655d8f81 100644 --- a/sdk/src/main/kotlin/io/github/wulkanowy/sdk/Sdk.kt +++ b/sdk/src/main/kotlin/io/github/wulkanowy/sdk/Sdk.kt @@ -168,6 +168,12 @@ class Sdk { scrapper.diaryId = value } + var unitId = 0 + set(value) { + field = value + scrapper.unitId = value + } + var kindergartenDiaryId = 0 set(value) { field = value @@ -247,11 +253,13 @@ class Sdk { scrapper.setAdditionalCookieManager(cookieManager) } - fun switchDiary(diaryId: Int, kindergartenDiaryId: Int, schoolYear: Int): Sdk { + @JvmOverloads + fun switchDiary(diaryId: Int, kindergartenDiaryId: Int, schoolYear: Int, unitId: Int = 0): Sdk { return also { it.diaryId = diaryId it.kindergartenDiaryId = kindergartenDiaryId it.schoolYear = schoolYear + it.unitId = unitId } }