Files
Georg-Stahn 51913f015b
All checks were successful
checks-impure / test (push) Successful in 29s
checks / test (push) Successful in 1m18s
assets1 / test (push) Successful in 22s
Georg-Stahn-georgs (#25)
Co-authored-by: sara-pervana <saramakishti@gmail.com>
Co-authored-by: ui-asset-bot <ui-asset-bot@gchq.icu>
Co-authored-by: Onur Arslan <runoxa@hotmail.com>
Co-authored-by: Arslan, Erdem <erdem.arslan@valtech.com>
Co-authored-by: Luis-Hebendanz <consulting@qube.email>
Reviewed-on: #25
Co-authored-by: Georg-Stahn <g.stahn@campus.tu-berlin.de>
Co-committed-by: Georg-Stahn <g.stahn@campus.tu-berlin.de>
2023-12-02 12:57:44 +01:00

55 lines
837 B
Python

from enum import Enum
from pydantic import BaseModel, Field
class Status(Enum):
ONLINE = "online"
OFFLINE = "offline"
UNKNOWN = "unknown"
class Machine(BaseModel):
name: str
status: Status
class RepositoryBase(BaseModel):
title: str
description: str | None = None
class RepositoryCreate(RepositoryBase):
pass
class Repository(RepositoryBase):
id: int
prod_id: str
class Config:
orm_mode = True
class ProducerBase(BaseModel):
id: int
class ProducerCreate(ProducerBase):
jsonblob: int = Field(
42,
title="The Json",
description="this is the value of json",
gt=30,
lt=50,
list=[1, 2, "3"],
)
class Producer(ProducerBase):
id: int
repos: list[Repository] = []
class Config:
orm_mode = True