44 lines
1.0 KiB
Python
44 lines
1.0 KiB
Python
"""
|
|
Classes designed to manage album-like objects
|
|
"""
|
|
|
|
from typing import Any, Dict, List, Union
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from .extra import ReleaseDatePrecision
|
|
from .paging import Paging
|
|
|
|
|
|
class SearchAlbum(BaseModel):
|
|
"Album as returned by the search API. Doesn't quite return a SimplifiedAlbum."
|
|
|
|
album_type: str
|
|
artists: List[Dict[str, Union[Dict[str, str], str]]]
|
|
available_markets: List[str]
|
|
external_urls: Dict[str, str]
|
|
href: str
|
|
spotify_id: str = Field(alias="id")
|
|
images: List[Dict[str, Any]]
|
|
name: str
|
|
release_date: str
|
|
release_date_precision: ReleaseDatePrecision
|
|
total_tracks: int
|
|
type_: str = Field(alias="type")
|
|
uri: str
|
|
|
|
|
|
class SimplifiedAlbum(SearchAlbum):
|
|
"""
|
|
Album as returned by the Album API
|
|
|
|
https://developer.spotify.com/documentation/web-api/reference/#object-simplifiedalbumobject
|
|
"""
|
|
|
|
copyrights: List[Dict[str, str]]
|
|
external_ids: Dict[str, str]
|
|
genres: List[str]
|
|
label: str
|
|
popularity: int
|
|
tracks: Paging
|