2022-04-03 13:51:26 +02:00
|
|
|
from typing import Any, List, Optional
|
2022-03-03 13:49:26 +01:00
|
|
|
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
class IotEntityBase(BaseModel):
|
|
|
|
id: int
|
|
|
|
description: str
|
|
|
|
|
|
|
|
|
|
|
|
class IotEntityCreate(IotEntityBase):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class IotEntity(IotEntityBase):
|
|
|
|
id: int
|
|
|
|
description: str
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
orm_mode = True
|
|
|
|
|
|
|
|
|
|
|
|
class UserBase(BaseModel):
|
|
|
|
email: str
|
2022-04-04 01:02:29 +02:00
|
|
|
username: str
|
2022-03-03 13:49:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
class UserCreate(UserBase):
|
|
|
|
password: str
|
|
|
|
|
|
|
|
|
|
|
|
class User(UserBase):
|
|
|
|
id: int
|
|
|
|
is_active: bool
|
2022-04-03 13:51:26 +02:00
|
|
|
authorized_devices: List[IotEntity] = []
|
2022-03-03 13:49:26 +01:00
|
|
|
|
|
|
|
class Config:
|
|
|
|
orm_mode = True
|