-
Notifications
You must be signed in to change notification settings - Fork 81
/
rest_api_models.py
47 lines (32 loc) · 950 Bytes
/
rest_api_models.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel
class SuccessResponse(BaseModel):
message: str = "Successful"
class SearchWindowSizeResponse(BaseModel):
sizes: List[int]
class AvailableSymbolsResponse(BaseModel):
symbols: List[str]
class MatchResponse(BaseModel):
symbol: str
distance: float
start_date: str
end_date: str
todays_value: Optional[float]
future_value: Optional[float]
change: Optional[float]
values: Optional[List[float]]
class TopKSearchResponse(BaseModel):
matches: List[MatchResponse] = []
forecast_type: str
forecast_confidence: float
anchor_symbol: str
anchor_values: Optional[List[float]]
window_size: int
top_k: int
future_size: int
class DataRefreshResponse(BaseModel):
message: str = "Last (most recent) refresh"
date: datetime
class IsReadyResponse(BaseModel):
is_ready: bool