File size: 1,093 Bytes
21db53c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from enum import Enum

from pydantic import Field

from app.Models.api_response.base import NekoProtocol
from app.Models.img_data import ImageData


class ImageStatus(str, Enum):
    MAPPED = "mapped"
    IN_QUEUE = "in_queue"


class QueryByIdApiResponse(NekoProtocol):
    img_status: ImageStatus = Field(description="The status of the image.\n"
                                                "Warning: If NekoImageGallery is deployed in a cluster, "
                                                "the `in_queue` might not be accurate since the index queue "
                                                "is independent of each service instance.")
    img: ImageData | None = Field(description="The mapped image data. Only available when `img_status = mapped`.")


class QueryImagesApiResponse(NekoProtocol):
    images: list[ImageData] = Field(description="The list of images.")
    next_page_offset: str | None = Field(description="The offset ID for the next page query. "
                                                     "If there are no more images, this field will be null.")