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
40 lines (29 loc) · 688 Bytes
/
location.py
File metadata and controls
40 lines (29 loc) · 688 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
33
34
35
36
37
38
39
40
from typing import Dict, List
from pydantic import BaseModel
from .latest import Latest
from .timeline import Timelines
class Location(BaseModel):
"""
Location model.
"""
id: int
country: str
country_code: str
country_population: int = None
province: str = ""
county: 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] = []