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