PhotosAPI/classes/models.py

69 lines
1.1 KiB
Python
Raw Normal View History

2023-02-16 15:56:28 +02:00
from typing import List, Union
2022-12-20 18:07:48 +02:00
from pydantic import BaseModel
2023-02-16 16:33:06 +02:00
2022-12-20 18:07:48 +02:00
class Photo(BaseModel):
id: str
album: str
hash: str
filename: str
2023-02-16 15:55:03 +02:00
class PhotoPublic(BaseModel):
id: str
caption: str
filename: str
class PhotoSearch(BaseModel):
id: str
filename: str
caption: Union[str, None]
2023-02-16 16:33:06 +02:00
2022-12-21 00:59:35 +02:00
class Video(BaseModel):
id: str
album: str
hash: str
filename: str
2023-02-16 16:33:06 +02:00
class VideoPublic(BaseModel):
id: str
caption: str
filename: str
class VideoSearch(BaseModel):
id: str
filename: str
caption: Union[str, None]
2023-02-16 16:33:06 +02:00
2022-12-20 18:07:48 +02:00
class Album(BaseModel):
id: str
name: str
title: str
class AlbumSearch(BaseModel):
id: str
name: str
title: str
2022-12-20 18:07:48 +02:00
class AlbumModified(BaseModel):
name: str
title: str
cover: Union[str, None]
2023-02-16 16:33:06 +02:00
class SearchResultsAlbum(BaseModel):
results: List[Album]
next_page: Union[str, None]
class SearchResultsPhoto(BaseModel):
results: List[PhotoSearch]
next_page: Union[str, None]
2022-12-20 18:07:48 +02:00
class SearchResultsVideo(BaseModel):
results: List[VideoSearch]
2023-02-16 16:04:28 +02:00
next_page: Union[str, None]
2023-02-16 16:33:06 +02:00
2023-02-16 16:04:28 +02:00
class EmailConfirmed(BaseModel):
detail: str