Skip to content

Commit

Permalink
fix: import
Browse files Browse the repository at this point in the history
  • Loading branch information
Negima1072 committed Aug 15, 2024
1 parent 53b9646 commit 1b6c42f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
27 changes: 27 additions & 0 deletions niconico/objects/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""This module contains the class that represents common objects."""

from __future__ import annotations

from typing import Literal

from pydantic import BaseModel, Field


class UserIcon(BaseModel):
"""A class that represents the icons of a user."""

small: str
large: str


class EssentialUser(BaseModel):
"""A class that represents an essential user object."""

type_: Literal["essential"] = Field(..., alias="type")
is_premium: bool = Field(..., alias="isPremium")
description: str
stripped_description: str = Field(..., alias="strippedDescription")
short_description: str = Field(..., alias="shortDescription")
id_: int = Field(..., alias="id")
nickname: str
icons: UserIcon
21 changes: 1 addition & 20 deletions niconico/objects/user/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,10 @@

from pydantic import BaseModel, Field

from niconico.objects.common import UserIcon
from niconico.objects.video import EssentialVideo, MylistItem, MylistSortKey, MylistSortOrder, Owner


class UserIcon(BaseModel):
"""A class that represents the icons of a user."""

small: str
large: str


class EssentialUser(BaseModel):
"""A class that represents an essential user object."""

type_: Literal["essential"] = Field(..., alias="type")
is_premium: bool = Field(..., alias="isPremium")
description: str
stripped_description: str = Field(..., alias="strippedDescription")
short_description: str = Field(..., alias="shortDescription")
id_: int = Field(..., alias="id")
nickname: str
icons: UserIcon


class SessionRelationships(BaseModel):
"""A class that represents the relationships of a user in a session."""

Expand Down
2 changes: 1 addition & 1 deletion niconico/objects/video/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import BaseModel, Field

from niconico.objects.user import EssentialUser
from niconico.objects.common import EssentialUser


class VideoCount(BaseModel):
Expand Down

0 comments on commit 1b6c42f

Please sign in to comment.