PhotosAPI/classes/models.py

83 lines
1.2 KiB
Python
Raw Normal View History

2023-02-16 15:56:28 +02:00
from typing import List, Union
2023-06-22 14:17:53 +03:00
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-03-12 15:59:13 +02:00
2023-02-16 15:55:03 +02:00
class PhotoPublic(BaseModel):
id: str
caption: str
filename: str
2023-03-12 15:59:13 +02:00
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-03-12 15:59:13 +02:00
2023-02-16 16:33:06 +02:00
class VideoPublic(BaseModel):
id: str
caption: str
filename: str
2023-03-12 15:59:13 +02:00
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
2023-03-12 15:59:13 +02:00
class AlbumSearch(BaseModel):
id: str
name: str
title: str
2023-03-12 15:59:13 +02:00
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]
2023-03-12 15:59:13 +02:00
class SearchResultsPhoto(BaseModel):
results: List[PhotoSearch]
next_page: Union[str, None]
2022-12-20 18:07:48 +02:00
2023-03-12 15:59:13 +02:00
class SearchResultsVideo(BaseModel):
results: List[VideoSearch]
2023-03-12 15:59:13 +02:00
next_page: Union[str, None]
2023-06-27 14:51:18 +03:00
class RandomSearchResultsPhoto(BaseModel):
results: List[PhotoSearch]
class RandomSearchResultsVideo(BaseModel):
results: List[VideoSearch]