Добавлена кодировка для типа datetime
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "osuclient"
|
||||
version = "0.5.2"
|
||||
version = "0.5.3"
|
||||
description = "Client for osu! API"
|
||||
readme = "README.md"
|
||||
authors = [
|
||||
|
||||
@ -25,14 +25,14 @@ class UserToken(Token):
|
||||
|
||||
|
||||
class Country(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
code: str
|
||||
name: str
|
||||
|
||||
|
||||
class Cover(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
custom_url: str | None
|
||||
url: str
|
||||
@ -40,7 +40,7 @@ class Cover(BaseModel):
|
||||
|
||||
|
||||
class DailyChallengeUserStats(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
daily_streak_best: int
|
||||
daily_streak_current: int
|
||||
@ -55,49 +55,49 @@ class DailyChallengeUserStats(BaseModel):
|
||||
|
||||
|
||||
class MonthlyPlaycount(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
start_date: str
|
||||
count: int
|
||||
|
||||
|
||||
class Page(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
html: str
|
||||
raw: str
|
||||
|
||||
|
||||
class RankHighest(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
rank: int
|
||||
updated_at: str
|
||||
|
||||
|
||||
class Kudosu(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
available: int
|
||||
total: int
|
||||
|
||||
|
||||
class ReplaysWatchedCount(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
start_date: str
|
||||
count: int
|
||||
|
||||
|
||||
class Level(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
current: int
|
||||
progress: int
|
||||
|
||||
|
||||
class GradeCounts(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
ss: int
|
||||
ssh: int
|
||||
@ -107,13 +107,13 @@ class GradeCounts(BaseModel):
|
||||
|
||||
|
||||
class Rank(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
country: int
|
||||
|
||||
|
||||
class UserStatistics(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
count_100: int
|
||||
count_300: int
|
||||
@ -140,21 +140,21 @@ class UserStatistics(BaseModel):
|
||||
|
||||
|
||||
class UserAchievement(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
achieved_at: str
|
||||
achievement_id: int
|
||||
|
||||
|
||||
class RankHistory(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
mode: Literal['osu', 'taiko', 'fruits', 'mania']
|
||||
data: list[int]
|
||||
|
||||
|
||||
class ActiveTournamentBanner(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
id: int
|
||||
tournament_id: int
|
||||
@ -163,7 +163,7 @@ class ActiveTournamentBanner(BaseModel):
|
||||
|
||||
|
||||
class Badge(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
awarded_at: datetime
|
||||
description: str
|
||||
@ -173,7 +173,7 @@ class Badge(BaseModel):
|
||||
|
||||
|
||||
class Team(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
id: int
|
||||
name: str
|
||||
@ -182,7 +182,7 @@ class Team(BaseModel):
|
||||
|
||||
|
||||
class ScoreStatistics(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
count_100: int
|
||||
count_300: int
|
||||
@ -193,13 +193,13 @@ class ScoreStatistics(BaseModel):
|
||||
|
||||
|
||||
class CurrentUserAttributes(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
pin: None
|
||||
|
||||
|
||||
class Covers(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
cover: str
|
||||
cover_2x: str = Field(..., alias='cover@2x')
|
||||
@ -212,7 +212,7 @@ class Covers(BaseModel):
|
||||
|
||||
|
||||
class Beatmapset(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
anime_cover: bool
|
||||
artist: str
|
||||
@ -239,7 +239,7 @@ class Beatmapset(BaseModel):
|
||||
|
||||
|
||||
class User(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
avatar_url: str
|
||||
country_code: str
|
||||
@ -261,28 +261,28 @@ class User(BaseModel):
|
||||
|
||||
|
||||
class Weight(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
percentage: float
|
||||
pp: float
|
||||
|
||||
|
||||
class BeatmapsetAvailability(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
download_disabled: bool
|
||||
more_information: str | None
|
||||
|
||||
|
||||
class BeatmapsetNominationsSummaryRequiredMeta(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
main_ruleset: int
|
||||
non_main_ruleset: int
|
||||
|
||||
|
||||
class BeatmapsetNominationsSummary(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
current: int
|
||||
eligible_main_rulesets: list[str]
|
||||
@ -290,7 +290,7 @@ class BeatmapsetNominationsSummary(BaseModel):
|
||||
|
||||
|
||||
class BeatmapsetExtended(Beatmapset):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
bpm: float
|
||||
can_be_hyped: bool
|
||||
@ -312,21 +312,21 @@ class BeatmapsetExtended(Beatmapset):
|
||||
|
||||
|
||||
class BeatmapOwner(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
id: int
|
||||
username: str
|
||||
|
||||
|
||||
class BeatmapFailtimes(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
fail: list[int]
|
||||
exit: list[int]
|
||||
|
||||
|
||||
class Beatmap(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
beatmapset_id: int
|
||||
difficulty_rating: float
|
||||
@ -361,7 +361,7 @@ class Beatmap(BaseModel):
|
||||
|
||||
|
||||
class BeatmapExtended(Beatmap):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
beatmapset: BeatmapsetExtended
|
||||
max_combo: int # type: ignore
|
||||
@ -371,7 +371,7 @@ class BeatmapExtended(Beatmap):
|
||||
|
||||
|
||||
class Score(BaseModel):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
accuracy: float
|
||||
best_id: int | None
|
||||
@ -399,7 +399,7 @@ class Score(BaseModel):
|
||||
|
||||
|
||||
class GetUser(User):
|
||||
model_config = ConfigDict(extra='forbid')
|
||||
model_config = ConfigDict(extra='forbid', json_encoders={datetime: str})
|
||||
|
||||
cover_url: str
|
||||
discord: str | None
|
||||
|
||||
Reference in New Issue
Block a user