forked from ExpDev07/coronavirus-tracker-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocation.py
More file actions
32 lines (29 loc) · 678 Bytes
/
location.py
File metadata and controls
32 lines (29 loc) · 678 Bytes
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
from pydantic import BaseModel
from typing import Dict, List
from .timeline import Timelines
from .latest import Latest
class Location(BaseModel):
"""
Location model.
"""
id: int
country: str
country_code: str
country_population: int = None
county: str = ''
province: str = ''
last_updated: str # TODO use datetime.datetime type.
coordinates: Dict
latest: Latest
timelines: Timelines = {}
class LocationResponse(BaseModel):
"""
Response for location.
"""
location: Location
class LocationsResponse(BaseModel):
"""
Response for locations.
"""
latest: Latest
locations: List[Location] = []