Skip to content

Commit

Permalink
🏷️ change most Anys to JsonElements
Browse files Browse the repository at this point in the history
  • Loading branch information
asoji committed Sep 14, 2024
1 parent 95b7138 commit 1b8af9d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 33 deletions.
25 changes: 13 additions & 12 deletions src/main/kotlin/one/devos/osuv2kt/models/beatmap/Beatmapset.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package one.devos.osuv2kt.models.beatmap

import com.google.gson.JsonElement
import java.time.OffsetDateTime

public data class Beatmapset(
Expand All @@ -23,21 +24,21 @@ public data class Beatmapset(

// Optionals
public val beatmaps: Array<Beatmap>,
public val converts: Any?,
public val converts: JsonElement?,
public val currentNominations: Array<BeatmapsetNomination>?,
public val currentUserAttributes: Any?,
public val description: Any?,
public val discussions: Any?,
public val events: Any?,
public val genre: Any?,
public val currentUserAttributes: JsonElement?,
public val description: JsonElement?,
public val discussions: JsonElement?,
public val events: JsonElement?,
public val genre: JsonElement?,
public val hasFavourited: Boolean?,
public val language: Any?,
public val nominations: Any?,
public val language: JsonElement?,
public val nominations: JsonElement?,
public val packTags: Array<String>?,
public val ratings: Any?,
public val recentFavourites: Any?,
public val relatedUsers: Any?,
public val user: Any?,
public val ratings: JsonElement?,
public val recentFavourites: JsonElement?,
public val relatedUsers: JsonElement?,
public val user: JsonElement?,
public val trackId: Int?,

// Extended
Expand Down
16 changes: 8 additions & 8 deletions src/main/kotlin/one/devos/osuv2kt/models/score/Score.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ public data class Score(
public val roomId: Int,
public val rulesetId: Int,
public val startedAt: OffsetDateTime?,
public val statistics: Any, // once again supposed to be ScoreStatistics
public val statistics: JsonElement, // once again supposed to be ScoreStatistics
public val totalScore: Int,
public val type: String,
public val userId: Int,

public val beatmap: Any?,
public val beatmapset: Any?,
public val beatmap: JsonElement?,
public val beatmapset: JsonElement?,
public val currentUserAttributes: JsonElement?,
public val match: Any?, // only for legacy match score
public val match: JsonElement?, // only for legacy match score
public val position: Int?,
public val rankCountry: Any?,
public val rankGlobal: Any?,
public val rankCountry: JsonElement?,
public val rankGlobal: JsonElement?,
public val scoresAround: MultiplayerScoresAround?, // Scores around the specified score. Only for multiplayer score
public val user: Any?,
public val weight: Any?
public val user: JsonElement?,
public val weight: JsonElement?
)
27 changes: 14 additions & 13 deletions src/main/kotlin/one/devos/osuv2kt/models/user/User.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package one.devos.osuv2kt.models.user

import com.google.gson.JsonElement
import one.devos.osuv2kt.models.*
import java.awt.Color
import java.time.OffsetDateTime

public data class User(
public val avatarUrl: String,
public val country: Any,
public val country: JsonElement,
public val countryCode: String,
public val cover: Any,
public val cover: JsonElement,
public val defaultGroup: String?,
public val id: Long,
public val isActive: Boolean,
Expand All @@ -28,7 +29,7 @@ public data class User(
public val activeTournamentBanners: Array<UserProfileBanner>?,
public val badges: Array<UserBadge>?,
public val beatmapPlaycountsCount: Int?,
public val blocks: Any?,
public val blocks: JsonElement?,
public val favouriteBeatmapsetCount: Int?,
public val followUserMapping: IntArray?,
public val followerCount: Int?,
Expand All @@ -38,23 +39,23 @@ public data class User(
public val lovedBeatmapsetCount: Int?,
public val mappingFollowerCount: Int?,
// TODO: monthlyPlaycounts
public val page: Any?,
public val pendingBeatmapsetCount: Any?,
public val previousUsernames: Any?,
public val page: JsonElement?,
public val pendingBeatmapsetCount: JsonElement?,
public val previousUsernames: JsonElement?,
public val rankHighest: UserRankHighest?,
public val rankHistory: Any?,
public val rankedBeatmapsetCount: Any?,
public val replaysWatchedCounts: Any?,
public val rankHistory: JsonElement?,
public val rankedBeatmapsetCount: JsonElement?,
public val replaysWatchedCounts: JsonElement?,
public val scoresBestCount: Int?,
public val scoresFirstCount: Int?,
public val scoresRecentCount: Int?,
public val sessionVerified: Boolean?,
public val statistics: UserStatistics?,
// TODO: statisticsRulesets
public val supportLevel: Any?,
public val unreadPmCount: Any?,
public val userAchievements: Any?,
public val userPreferences: Any?,
public val supportLevel: JsonElement?,
public val unreadPmCount: JsonElement?,
public val userAchievements: JsonElement?,
public val userPreferences: JsonElement?,

// Extended
public val coverUrl: String?,
Expand Down

0 comments on commit 1b8af9d

Please sign in to comment.