Module sql_app.schemas

Expand source code
from typing import List, Optional
from datetime import datetime, date
from pydantic import BaseModel


class DeviceLicenseBase(BaseModel):
    device_id: int
    license_id: int
    assigned_datetime: str


class DeviceLicenseCreate(DeviceLicenseBase):
    pass


class DeviceLicense(DeviceLicenseCreate):
    """
    Class used for creating and reading devices_licenses entries
    """
    id: int

    class Config:
        orm_mode = True


class USBLogBase(BaseModel):
    timestamp: datetime
    status: str


class USBLogCreate(USBLogBase):
    pass


class USBLog(USBLogBase):
    """
    Class used for creating and reading usb_logs entries
    """
    id: int
    device_id: int
    pc_id: int

    class Config:
        orm_mode = True


class DeviceBase(BaseModel):
    vendor_id: str
    product_id: str
    serial_number: str
    inventory_number: str
    comment: str


class DeviceCreate(DeviceBase):
    pass


class Device(DeviceCreate):
    """
    Class used for creating and reading devices entries
    """
    id: int
    logs: List[USBLog] = []
    licenses: List[DeviceLicense] = []

    class Config:
        orm_mode = True


class DeviceTemp(BaseModel):
    """
    Class used for reading data from client
    """
    vendor_id: str
    product_id: str
    serial_number: str


class LDLogBase(BaseModel):
    timestamp: datetime
    status: str


class LDLogCreate(LDLogBase):
    pass


class LDLog(LDLogCreate):
    """
    Class used for creating and reading ld_logs entries
    """
    id: int
    head_id: int
    body_id: int

    class Config:
        orm_mode = True


class BodyDeviceBase(BaseModel):
    serial_number: str
    inventory_number: str
    comment: str


class BodyDeviceCreate(BodyDeviceBase):
    pass


class BodyDevice(BodyDeviceCreate):
    """
    Class used for creating and reading body_devices entries
    """
    id: int
    logs: List[LDLog] = []

    class Config:
        orm_mode = True


class BodyDeviceTemp(BaseModel):
    """
    Class used for reading body device data from client
    """
    serial_number: str


class HeadDeviceBase(BaseModel):
    serial_number: str
    inventory_number: str
    comment: str


class HeadDeviceCreate(HeadDeviceBase):
    pass


class HeadDevice(HeadDeviceCreate):
    """
    Class used for creating and reading head_devices entries
    """
    id: int
    logs: List[LDLog] = []

    class Config:
        orm_mode = True


class HeadDeviceTemp(BaseModel):
    """
    Class used for reading head device data from client
    """
    serial_number: str


class PCBase(BaseModel):
    username: str
    hostname: str


class PCCreate(PCBase):
    pass


class PC(PCCreate):
    """
    Class used for creating and reading pc entries
    """
    id: int
    logs_pc: List[USBLog] = []
    logs_ld: List[LDLog] = []

    class Config:
        orm_mode = True


class TeamBase(BaseModel):
    name: str


class TeamCreate(TeamBase):
    pass


class Team(TeamCreate):
    """
    Class used for creating and reading team entries
    """
    id: int
    devices: List[Device] = []

    class Config:
        orm_mode = True


class LicenseBase(BaseModel):
    name: str
    license_id: str
    expiration_date: date


class LicenseCreate(LicenseBase):
    pass


class License(LicenseCreate):
    """
    Class used for creating and reading licenses entries
    """
    id: int
    devices: List[DeviceLicense] = []
    head_devices: List[HeadDevice] = []
    body_devices: List[BodyDevice] = []

    class Config:
        orm_mode = True


class USBTempBase(BaseModel):
    """
    Class used for reading data from keyman detecting client messages
    """
    username: str
    hostname: str
    timestamp: str
    device: DeviceTemp
    status: str


class USBTempCreate(USBTempBase):
    pass


class USBTemp(USBTempBase):
    id: int
    device_id: int

    class Config:
        orm_mode = True


class LDTempBase(BaseModel):
    """
    Class used for reading data from debugger detecting client messages
    """
    username: str
    hostname: str
    timestamp: str
    head_device: HeadDeviceTemp
    body_device: BodyDeviceTemp
    status: str


class LDTempCreate(LDTempBase):
    pass


class LDTemp(LDTempCreate):
    id: int
    head_id: int
    body_id: int

    class Config:
        orm_mode = True


class UserBase(BaseModel):
    """
    Classes used for creating new User entry
    """
    username: str
    password: str
    role: str


class UserCreate(UserBase):
    pass


class User(UserCreate):
    id: int

    class Config:
        orm_mode = True

Classes

class BodyDevice (**data: Any)

Class used for creating and reading body_devices entries

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class BodyDevice(BodyDeviceCreate):
    """
    Class used for creating and reading body_devices entries
    """
    id: int
    logs: List[LDLog] = []

    class Config:
        orm_mode = True

Ancestors

Subclasses

  • pydantic.main.BodyDevice
  • pydantic.main.BodyDevice

Class variables

var Config
var id : int
var logs : List[LDLog]
class BodyDeviceBase (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class BodyDeviceBase(BaseModel):
    serial_number: str
    inventory_number: str
    comment: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var comment : str
var inventory_number : str
var serial_number : str
class BodyDeviceCreate (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class BodyDeviceCreate(BodyDeviceBase):
    pass

Ancestors

  • BodyDeviceBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

class BodyDeviceTemp (**data: Any)

Class used for reading body device data from client

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class BodyDeviceTemp(BaseModel):
    """
    Class used for reading body device data from client
    """
    serial_number: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var serial_number : str
class Device (**data: Any)

Class used for creating and reading devices entries

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class Device(DeviceCreate):
    """
    Class used for creating and reading devices entries
    """
    id: int
    logs: List[USBLog] = []
    licenses: List[DeviceLicense] = []

    class Config:
        orm_mode = True

Ancestors

Subclasses

  • pydantic.main.Device
  • pydantic.main.Device
  • pydantic.main.Device
  • pydantic.main.Device
  • pydantic.main.Device
  • pydantic.main.Device
  • pydantic.main.Device
  • pydantic.main.Device
  • pydantic.main.Device
  • pydantic.main.Device
  • pydantic.main.Device
  • pydantic.main.Device

Class variables

var Config
var id : int
var licenses : List[DeviceLicense]
var logs : List[USBLog]
class DeviceBase (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class DeviceBase(BaseModel):
    vendor_id: str
    product_id: str
    serial_number: str
    inventory_number: str
    comment: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var comment : str
var inventory_number : str
var product_id : str
var serial_number : str
var vendor_id : str
class DeviceCreate (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class DeviceCreate(DeviceBase):
    pass

Ancestors

  • DeviceBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

class DeviceLicense (**data: Any)

Class used for creating and reading devices_licenses entries

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class DeviceLicense(DeviceLicenseCreate):
    """
    Class used for creating and reading devices_licenses entries
    """
    id: int

    class Config:
        orm_mode = True

Ancestors

Subclasses

  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense
  • pydantic.main.DeviceLicense

Class variables

var Config
var id : int
class DeviceLicenseBase (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class DeviceLicenseBase(BaseModel):
    device_id: int
    license_id: int
    assigned_datetime: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var assigned_datetime : str
var device_id : int
var license_id : int
class DeviceLicenseCreate (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class DeviceLicenseCreate(DeviceLicenseBase):
    pass

Ancestors

Subclasses

class DeviceTemp (**data: Any)

Class used for reading data from client

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class DeviceTemp(BaseModel):
    """
    Class used for reading data from client
    """
    vendor_id: str
    product_id: str
    serial_number: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var product_id : str
var serial_number : str
var vendor_id : str
class HeadDevice (**data: Any)

Class used for creating and reading head_devices entries

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class HeadDevice(HeadDeviceCreate):
    """
    Class used for creating and reading head_devices entries
    """
    id: int
    logs: List[LDLog] = []

    class Config:
        orm_mode = True

Ancestors

Subclasses

  • pydantic.main.HeadDevice
  • pydantic.main.HeadDevice

Class variables

var Config
var id : int
var logs : List[LDLog]
class HeadDeviceBase (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class HeadDeviceBase(BaseModel):
    serial_number: str
    inventory_number: str
    comment: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var comment : str
var inventory_number : str
var serial_number : str
class HeadDeviceCreate (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class HeadDeviceCreate(HeadDeviceBase):
    pass

Ancestors

  • HeadDeviceBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

class HeadDeviceTemp (**data: Any)

Class used for reading head device data from client

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class HeadDeviceTemp(BaseModel):
    """
    Class used for reading head device data from client
    """
    serial_number: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var serial_number : str
class LDLog (**data: Any)

Class used for creating and reading ld_logs entries

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class LDLog(LDLogCreate):
    """
    Class used for creating and reading ld_logs entries
    """
    id: int
    head_id: int
    body_id: int

    class Config:
        orm_mode = True

Ancestors

Subclasses

  • pydantic.main.LDLog
  • pydantic.main.LDLog
  • pydantic.main.LDLog
  • pydantic.main.LDLog
  • pydantic.main.LDLog
  • pydantic.main.LDLog
  • pydantic.main.LDLog
  • pydantic.main.LDLog
  • pydantic.main.LDLog
  • pydantic.main.LDLog

Class variables

var Config
var body_id : int
var head_id : int
var id : int
class LDLogBase (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class LDLogBase(BaseModel):
    timestamp: datetime
    status: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var status : str
var timestamp : datetime.datetime
class LDLogCreate (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class LDLogCreate(LDLogBase):
    pass

Ancestors

  • LDLogBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

class LDTemp (**data: Any)

Class used for reading data from debugger detecting client messages

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class LDTemp(LDTempCreate):
    id: int
    head_id: int
    body_id: int

    class Config:
        orm_mode = True

Ancestors

Class variables

var Config
var body_id : int
var head_id : int
var id : int
class LDTempBase (**data: Any)

Class used for reading data from debugger detecting client messages

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class LDTempBase(BaseModel):
    """
    Class used for reading data from debugger detecting client messages
    """
    username: str
    hostname: str
    timestamp: str
    head_device: HeadDeviceTemp
    body_device: BodyDeviceTemp
    status: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var body_deviceBodyDeviceTemp
var head_deviceHeadDeviceTemp
var hostname : str
var status : str
var timestamp : str
var username : str
class LDTempCreate (**data: Any)

Class used for reading data from debugger detecting client messages

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class LDTempCreate(LDTempBase):
    pass

Ancestors

  • LDTempBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

class License (**data: Any)

Class used for creating and reading licenses entries

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class License(LicenseCreate):
    """
    Class used for creating and reading licenses entries
    """
    id: int
    devices: List[DeviceLicense] = []
    head_devices: List[HeadDevice] = []
    body_devices: List[BodyDevice] = []

    class Config:
        orm_mode = True

Ancestors

Subclasses

  • pydantic.main.License
  • pydantic.main.License

Class variables

var Config
var body_devices : List[BodyDevice]
var devices : List[DeviceLicense]
var head_devices : List[HeadDevice]
var id : int
class LicenseBase (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class LicenseBase(BaseModel):
    name: str
    license_id: str
    expiration_date: date

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var expiration_date : datetime.date
var license_id : str
var name : str
class LicenseCreate (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class LicenseCreate(LicenseBase):
    pass

Ancestors

  • LicenseBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

class PC (**data: Any)

Class used for creating and reading pc entries

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class PC(PCCreate):
    """
    Class used for creating and reading pc entries
    """
    id: int
    logs_pc: List[USBLog] = []
    logs_ld: List[LDLog] = []

    class Config:
        orm_mode = True

Ancestors

  • PCCreate
  • PCBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

  • pydantic.main.PC
  • pydantic.main.PC
  • pydantic.main.PC
  • pydantic.main.PC
  • pydantic.main.PC
  • pydantic.main.PC

Class variables

var Config
var id : int
var logs_ld : List[LDLog]
var logs_pc : List[USBLog]
class PCBase (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class PCBase(BaseModel):
    username: str
    hostname: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var hostname : str
var username : str
class PCCreate (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class PCCreate(PCBase):
    pass

Ancestors

  • PCBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

class Team (**data: Any)

Class used for creating and reading team entries

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class Team(TeamCreate):
    """
    Class used for creating and reading team entries
    """
    id: int
    devices: List[Device] = []

    class Config:
        orm_mode = True

Ancestors

Subclasses

  • pydantic.main.Team
  • pydantic.main.Team

Class variables

var Config
var devices : List[Device]
var id : int
class TeamBase (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class TeamBase(BaseModel):
    name: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var name : str
class TeamCreate (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class TeamCreate(TeamBase):
    pass

Ancestors

  • TeamBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

class USBLog (**data: Any)

Class used for creating and reading usb_logs entries

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class USBLog(USBLogBase):
    """
    Class used for creating and reading usb_logs entries
    """
    id: int
    device_id: int
    pc_id: int

    class Config:
        orm_mode = True

Ancestors

  • USBLogBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog
  • pydantic.main.USBLog

Class variables

var Config
var device_id : int
var id : int
var pc_id : int
class USBLogBase (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class USBLogBase(BaseModel):
    timestamp: datetime
    status: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var status : str
var timestamp : datetime.datetime
class USBLogCreate (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class USBLogCreate(USBLogBase):
    pass

Ancestors

  • USBLogBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation
class USBTemp (**data: Any)

Class used for reading data from keyman detecting client messages

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class USBTemp(USBTempBase):
    id: int
    device_id: int

    class Config:
        orm_mode = True

Ancestors

  • USBTempBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var Config
var device_id : int
var id : int
class USBTempBase (**data: Any)

Class used for reading data from keyman detecting client messages

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class USBTempBase(BaseModel):
    """
    Class used for reading data from keyman detecting client messages
    """
    username: str
    hostname: str
    timestamp: str
    device: DeviceTemp
    status: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var deviceDeviceTemp
var hostname : str
var status : str
var timestamp : str
var username : str
class USBTempCreate (**data: Any)

Class used for reading data from keyman detecting client messages

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class USBTempCreate(USBTempBase):
    pass

Ancestors

  • USBTempBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation
class User (**data: Any)

Classes used for creating new User entry

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class User(UserCreate):
    id: int

    class Config:
        orm_mode = True

Ancestors

Class variables

var Config
var id : int
class UserBase (**data: Any)

Classes used for creating new User entry

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class UserBase(BaseModel):
    """
    Classes used for creating new User entry
    """
    username: str
    password: str
    role: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var password : str
var role : str
var username : str
class UserCreate (**data: Any)

Classes used for creating new User entry

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class UserCreate(UserBase):
    pass

Ancestors

  • UserBase
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses