From 95321b4895dd0ba09282e5f482e9870830c6f97b Mon Sep 17 00:00:00 2001 From: moonleay Date: Mon, 29 Jan 2024 16:40:38 +0100 Subject: [PATCH] fix: fixed schedules not being deserialized correctly Signed-off-by: moonleay --- .../api/splatoon3ink/schedules/BannerImage.kt | 29 ++++++++++++++ .../schedules/CoopGroupingSchedule.kt | 2 +- .../api/splatoon3ink/schedules/CoopSetting.kt | 39 +++++++++++++++++++ .../splatoon3ink/schedules/TeamContestNode.kt | 33 ++++++++++++++++ .../schedules/TeamContestSchedules.kt | 3 +- 5 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/BannerImage.kt create mode 100644 src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/CoopSetting.kt create mode 100644 src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/TeamContestNode.kt diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/BannerImage.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/BannerImage.kt new file mode 100644 index 0000000..3713c22 --- /dev/null +++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/BannerImage.kt @@ -0,0 +1,29 @@ +/* + * lilJudd + * Copyright (C) 2024 moonleay + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package net.moonleay.lilJudd.data.api.splatoon3ink.schedules + + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class BannerImage( + @SerialName("url") + val url: String, +) diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/CoopGroupingSchedule.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/CoopGroupingSchedule.kt index 412e5fd..23770d9 100644 --- a/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/CoopGroupingSchedule.kt +++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/CoopGroupingSchedule.kt @@ -25,7 +25,7 @@ import kotlinx.serialization.Serializable @Serializable data class CoopGroupingSchedule( @SerialName("bannerImage") - val bannerImage: String?, // is null + val bannerImage: BannerImage?, // is null @SerialName("bigRunSchedules") val bigRunSchedules: BigRunSchedules, @SerialName("regularSchedules") diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/CoopSetting.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/CoopSetting.kt new file mode 100644 index 0000000..c4dce9f --- /dev/null +++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/CoopSetting.kt @@ -0,0 +1,39 @@ +/* + * lilJudd + * Copyright (C) 2024 moonleay + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package net.moonleay.lilJudd.data.api.splatoon3ink.schedules + + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class CoopSetting( + @SerialName("boss") + val boss: String?, // Not really String, but idk + @SerialName("coopStage") + val coopStage: CoopStage, + @SerialName("__isCoopSetting") + val isCoopSetting: String, + @SerialName("rule") + val rule: String, + @SerialName("__typename") + val typename: String, + @SerialName("weapons") + val weapons: List +) diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/TeamContestNode.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/TeamContestNode.kt new file mode 100644 index 0000000..309b1f9 --- /dev/null +++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/TeamContestNode.kt @@ -0,0 +1,33 @@ +/* + * lilJudd + * Copyright (C) 2024 moonleay + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package net.moonleay.lilJudd.data.api.splatoon3ink.schedules + + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class TeamContestNode( + @SerialName("endTime") + val endTime: String, + @SerialName("setting") + val setting: CoopSetting, + @SerialName("startTime") + val startTime: String +) diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/TeamContestSchedules.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/TeamContestSchedules.kt index e328191..f4e9adc 100644 --- a/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/TeamContestSchedules.kt +++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/splatoon3ink/schedules/TeamContestSchedules.kt @@ -23,8 +23,7 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable -// TODO: Please check what goes here. data class TeamContestSchedules( @SerialName("nodes") - val nodes: List // This is a placeholder. + val nodes: List // This is a placeholder. )