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


class DeviceCreate(DeviceBase):
    pass


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

    class Config:
        orm_mode = True


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


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 HeadDeviceBase(BaseModel):
    serial_number: 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 PCBase(BaseModel):
    username: str
    hostname: str


class PCCreate(PCBase):
    pass


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

    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
    pcs: List[PC] = []

    class Config:
        orm_mode = True


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


class LicenseCreate(LicenseBase):
    pass


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

    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: DeviceBase
    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: HeadDeviceBase
    body_device: BodyDeviceBase
    status: str


class LDTempCreate(LDTempBase):
    pass


class LDTemp(LDTempCreate):
    id: int
    head_id: int
    body_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

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

Ancestors

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

Subclasses

Class variables

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 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
    assigned: bool
    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

Class variables

var Config
var assigned : bool
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

Ancestors

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

Subclasses

Class variables

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

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 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

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

Ancestors

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

Subclasses

Class variables

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 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

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: HeadDeviceBase
    body_device: BodyDeviceBase
    status: str

Ancestors

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

Subclasses

Class variables

var body_deviceBodyDeviceBase
var head_deviceHeadDeviceBase
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] = []

    class Config:
        orm_mode = True

Ancestors

Subclasses

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

Class variables

var Config
var devices : List[DeviceLicense]
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
    expiration_date: date

Ancestors

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

Subclasses

Class variables

var expiration_date : datetime.date
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
    assigned: bool
    logs_pc: List[USBLog] = []

    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
  • pydantic.main.PC
  • pydantic.main.PC

Class variables

var Config
var assigned : bool
var id : int
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
    pcs: List[PC] = []

    class Config:
        orm_mode = True

Ancestors

Subclasses

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

Class variables

var Config
var id : int
var pcs : List[PC]
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: DeviceBase
    status: str

Ancestors

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

Subclasses

Class variables

var deviceDeviceBase
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