Add a paging object
This commit is contained in:
parent
f240e0daa0
commit
2337838886
@ -3,6 +3,6 @@ Client-agnostic model for marshalling Spotify data types.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from .album import SearchAlbum
|
from .album import SearchAlbum
|
||||||
from .pagination import Paginated
|
from .paging import Paging
|
||||||
|
|
||||||
__all__ = ["Paginated", "SearchAlbum"]
|
__all__ = ["Paging", "SearchAlbum"]
|
||||||
|
@ -8,7 +8,7 @@ from pydantic import BaseModel, Field
|
|||||||
|
|
||||||
|
|
||||||
class SearchAlbum(BaseModel):
|
class SearchAlbum(BaseModel):
|
||||||
"Album as returned by the search API"
|
"Album as returned by the search API. Doesn't quite return a SimplifiedAlbum."
|
||||||
|
|
||||||
album_type: str
|
album_type: str
|
||||||
artists: List[Dict[str, Union[Dict[str, str], str]]]
|
artists: List[Dict[str, Union[Dict[str, str], str]]]
|
||||||
|
19
spotify_model/paging.py
Normal file
19
spotify_model/paging.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
"""
|
||||||
|
Objects used for paging Spotify results
|
||||||
|
"""
|
||||||
|
|
||||||
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
|
|
||||||
|
class Paging(BaseModel):
|
||||||
|
"https://developer.spotify.com/documentation/web-api/reference/#object-pagingobject"
|
||||||
|
|
||||||
|
href: str
|
||||||
|
items: List[Dict[str, Any]]
|
||||||
|
limit: int
|
||||||
|
next_href: Optional[str] = Field(alias="next")
|
||||||
|
offset: int
|
||||||
|
previous_href: Optional[str] = Field(alias="previous")
|
||||||
|
total: int
|
Loading…
Reference in New Issue
Block a user