This repository has been archived on 2020-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
statuspage/app/schemas.py

53 lines
845 B
Python
Raw Normal View History

import time
from typing import List, Optional
from pydantic import BaseModel
class ServiceBase(BaseModel):
name: str
is_private: bool = True
description: Optional[str] = None
service_type: int
url: str
owner_id: Optional[int] = None
is_active: bool = True
updated_unix: float
class Service(BaseModel):
name: str
owner_id: int
is_active: bool = True
created_unix: float
class ServiceCreate(ServiceBase):
pass
class Service(ServiceBase):
owner_id: int
class Config:
orm_mode = True
class UserBase(BaseModel):
name: str
full_name: Optional[str] = None
is_active: bool = True
class User(BaseModel):
name: str
full_name: Optional[str] = None
is_active: bool = True
last_login_unix: float
created_unix: float
class UserCreate(UserBase):
password: str
class User(UserBase):
pass
class Config:
orm_mode = True