Add a release date precision enum
This commit is contained in:
parent
2337838886
commit
ad39ddf83f
@ -3,6 +3,7 @@ Client-agnostic model for marshalling Spotify data types.
|
||||
"""
|
||||
|
||||
from .album import SearchAlbum
|
||||
from .extra import ReleaseDatePrecision
|
||||
from .paging import Paging
|
||||
|
||||
__all__ = ["Paging", "SearchAlbum"]
|
||||
__all__ = ["Paging", "ReleaseDatePrecision", "SearchAlbum"]
|
||||
|
@ -6,6 +6,8 @@ from typing import Any, Dict, List, Union
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from .extra import ReleaseDatePrecision
|
||||
|
||||
|
||||
class SearchAlbum(BaseModel):
|
||||
"Album as returned by the search API. Doesn't quite return a SimplifiedAlbum."
|
||||
@ -19,7 +21,7 @@ class SearchAlbum(BaseModel):
|
||||
images: List[Dict[str, Any]]
|
||||
name: str
|
||||
release_date: str
|
||||
release_date_precision: str
|
||||
release_date_precision: ReleaseDatePrecision
|
||||
total_tracks: int
|
||||
type_: str = Field(alias="type")
|
||||
uri: str
|
||||
|
13
spotify_model/extra.py
Normal file
13
spotify_model/extra.py
Normal file
@ -0,0 +1,13 @@
|
||||
"""
|
||||
Extra type definitions that don't necessarily belong in other categories.
|
||||
"""
|
||||
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class ReleaseDatePrecision(Enum):
|
||||
"Release date precision"
|
||||
|
||||
YEAR = "year"
|
||||
MONTH = "month"
|
||||
DAY = "day"
|
Loading…
Reference in New Issue
Block a user